<jupyter_start><jupyter_text><jupyter_code>from urllib.request import urlopen as uReq
from bs4 import BeautifulSoup as soup
#Variable to whatcha want.
my_url = "https://www.fool.com/investing/top-stocks-to-buy/"
#Open chakras
uClient = uReq(my_url)

#Grab the shtuff
page_html = uClient.read()
uClient.close()

#html parser
page_soup = soup(page_html, "html.parser")
#just looking around
page_soup.h1
#are you accusing me of stealing?
page_soup.ol
#grabs each thingymerjig
containers = page_soup.findAll("div", {"class":"ticker-row"})
#LOOK AT IT!
len(containers)
containers[0]
#inside my box? *chuckle* another box.
contain = containers[0]
container = containers[0]
container.div
for container in containers:
  brand = container.div.h3
  nums = container.div.h4


  print(brand)
  print(nums)
  
import plotly.graph_objects as go

#make it presentable 
import plotly.figure_factory as ff
data_matrix = [brand, nums],
    fig = ff.create_table(data_matrix)
fig.show()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.109375, 'fraction_numerical': 0.0068359375, 'mean_word_length': 4.662983425414365, 'pattern_counts': {'":': 1, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 1, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '484891', 'license': 'MIT', 'n_tokens_mistral': 395, 'n_tokens_neox': 382, 'n_words': 93, 'path': 'webScrape.ipynb', 'repo_name': 'Jack-TBarnett/github-slideshow', 'size': '1024'}