Skip to content

Commit

Permalink
Update scraper.py
Browse files Browse the repository at this point in the history
  • Loading branch information
LilaRa committed Jan 25, 2018
1 parent fda4583 commit 2d21dc7
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion scraper.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,15 @@
print myname
# # Find something on the page using css selectors
root = lxml.html.fromstring(html)
# root.cssselect("div[align='left']")("a)
#root.cssselect("div[align='left']")("a)
#grab all the a tags and put in selectstuff list variable
selectstuff = root.cssselect ("a")
print selectstuff
#start looping through the list of results
for i in selectstuff:
print i.text # .text grabs the text content of the tag in i
print i.attrib ['href'] # .attrib grabs the value of the attribute specified

print root
listylist=["p1","p2","p3"]
print listylist
Expand Down

0 comments on commit 2d21dc7

Please sign in to comment.