Skip to content

Instantly share code, notes, and snippets.

@pranjalAI
Created November 28, 2020 17:54
Show Gist options
  • Save pranjalAI/ac4462c9fd5269cbc46605cb3f697d53 to your computer and use it in GitHub Desktop.
Save pranjalAI/ac4462c9fd5269cbc46605cb3f697d53 to your computer and use it in GitHub Desktop.
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