Skip to content

Commit

Permalink
Merge pull request #29 from AK-007/master
Browse files Browse the repository at this point in the history
Web Scraping solution
  • Loading branch information
mubaris authored Jan 15, 2018
2 parents ab38319 + a30d8d3 commit 20dc3e3
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions Solutions/AK-007/Task3/web.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
from urllib.request import urlopen
from bs4 import BeautifulSoup

web="https://scirate.com/"

page=urlopen(web)

soup=BeautifulSoup(page,"html.parser")

all_names=soup.find_all('div',attrs={'class' : 'title'})
all_links=soup.find_all('a',attrs={'title':'Download PDF'})
i=0
for name in all_names:
print('Name = '+name.text)
if(i<len(all_links)):
print('Link = '+all_links[i]['href'])
i=i+1

0 comments on commit 20dc3e3

Please sign in to comment.