Advertisement
Guest User

Untitled

a guest
Sep 22nd, 2021
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. import requests
  2. from bs4 import BeautifulSoup
  3. import os
  4.  
  5. url = 'https://www.selectedvendors.com/Goods/categoryGoodsList/53/Cabinets'
  6.  
  7. r = requests.get(url)
  8.  
  9. soup = BeautifulSoup(r.text, 'html.parser')
  10.  
  11. pees = soup.find_all('p')
  12. print(pees)
  13.  
  14. for link in soup
  15.  
  16. images = soup.find_all('img')
  17.  
  18. #print(images)
  19.  
  20. #num = 0
  21.  
  22. # for image in images:
  23. #if 'http' in image.get('src'):
  24. #link = image['src']
  25.  
  26. #with open(str(num) + 'jpg', 'wb') as f:
  27. #im = requests.get(link)
  28. #f.write(im.content)
  29. #num += 1
  30.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement