Created
November 28, 2020 17:54
-
-
Save pranjalAI/ac4462c9fd5269cbc46605cb3f697d53 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
pub_links={} | |
for link in links: | |
response = requests.get(link) | |
soup = BeautifulSoup(response.text, "lxml" ) | |
data = soup.find('div', class_ = 'js-postListHandle') | |
my_data=data.find('div',class_ = 'js-postListHandle') | |
final_data=my_data.find_all('div',{'class':'postArticle-content'}) | |
Alinks=[] | |
for Alink in final_data: | |
href=Alink.find("a").get('href').split("?")[0] | |
Alinks.append(href) | |
pubname=link.split("//")[1].split("/")[-2] | |
pub_links[pubname]=Alinks |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment