Skip to content

Commit

Permalink
Update scraper.py
Browse files Browse the repository at this point in the history
  • Loading branch information
hicham20201441 committed Aug 27, 2020
1 parent 74d88d1 commit 7eb77f1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion scraper.py
Expand Up @@ -11,9 +11,11 @@
# # Find something on the page using css selectors
root = lxml.html.fromstring(html)
urls=[e.get("href") for e in root.cssselect("a")]
nour=set(url)
while(len(urls)>0):
if url in urls[0] and urls[0]!=url:
if url in urls[0] and urls[0] not in nour:
ur=urls[0]
nour.add(ur)
print("scraping: "+ur)
html1= scraperwiki.scrape(ur)
root1 = lxml.html.fromstring(html1)
Expand Down

0 comments on commit 7eb77f1

Please sign in to comment.