Skip to content

Instantly share code, notes, and snippets.

@stephepush
Created April 25, 2017 18:13
Show Gist options
  • Select an option

  • Save stephepush/d8b36851975219ba6c255c83b61fd66b to your computer and use it in GitHub Desktop.

Select an option

Save stephepush/d8b36851975219ba6c255c83b61fd66b to your computer and use it in GitHub Desktop.
import bs4
from urllib.request import urlopen as uReq
from bs4 import BeautifulSoup as soup
my_url = 'https://site.com'
#opening up connection, grabbing the page
uClient = uReq(my_url)
page_html = uClient.read()
uClient.close()
#html parsing
page_soup = soup(page_html, "html.parser")
#grabs each group
items = page_soup.findAll("div", {"class":"group"})
len(items)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment