Advertisement
dereksir

Untitled

Feb 22nd, 2024
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.43 KB | None | 0 0
  1. import requests
  2. from bs4 import BeautifulSoup
  3.  
  4. # Send a GET request to the target page
  5. response = requests.get("https://scrapeme.live/shop/")
  6.  
  7. # print(response.text)
  8.  
  9. # Parse the HTML content
  10. soup = BeautifulSoup(response.text, "html.parser")
  11.  
  12. # Find all h2s (elements containing the pokemon names)
  13. pokemon_names = soup.find_all("h2")
  14.  
  15. # Extract the text from each element
  16. for name in pokemon_names:
  17.     print(name.text)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement