Created
August 17, 2019 05:22
-
-
Save a-m-dev/9a10dbd961aa41b9bbd708cce2d9eb89 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
from bs4 import BeautifulSoup | |
response = requests.get('https://www.varzesh3.com').content | |
x = response.decode('utf8') | |
# y = x.encode("ascii",'ignore') | |
# # print(response.text) | |
soup = BeautifulSoup(x , 'html.parser') | |
# print(soup) | |
news = soup.find_all(class_='small-news-link') | |
for post in news: | |
print(post['href'], ' >>>> ' , post.get_text()) | |
# f.close(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment