Skip to content

Instantly share code, notes, and snippets.

@hansnans
Last active June 18, 2020 10:33
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hansnans/2c48509bc91de3bc11b3994b4c849742 to your computer and use it in GitHub Desktop.
Save hansnans/2c48509bc91de3bc11b3994b4c849742 to your computer and use it in GitHub Desktop.
Webscrapper python example
#!/usr/bin/env python3
import requests
from bs4 import BeautifulSoup
if __name__ == '__main__':
URL = 'https://webscraper.io/test-sites/e-commerce/allinone'
plain_html = requests.get(URL).text
parser = BeautifulSoup(plain_html, 'html.parser')
elements = parser.find('div', {'class': 'test-site'})
beautifulsoup4==4.9.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment