Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from bs4 import BeautifulSoup
- import requests as re
- 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'}
- )
- content=BeautifulSoup(siteDetails.content)
- print(content.prettify())
- for i in content.find_all("a"):
- print(i.text,':',i.get("href"))
Add Comment
Please, Sign In to add comment