Guest User

Untitled

a guest
Dec 15th, 2017
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. from bs4 import BeautifulSoup
  2. import requests as re
  3. siteDetails=re.get("https://www.macys.com", headers={'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36'}
  4. )
  5. content=BeautifulSoup(siteDetails.content)
  6. print(content.prettify())
  7. for i in content.find_all("a"):
  8. print(i.text,':',i.get("href"))
Add Comment
Please, Sign In to add comment