Answers for "python getting information from a web page"

1

python get html info

from bs4 import BeautifulSoup

my_HTML = #Some HTML file (could be a website, you can use urllib for that)

soup = BeautifulSoup(my_HTML, 'html.parser')

print(soup.prettify())
Posted by: Guest on August-19-2020
-1

web scraper python

>>> raw_html = simple_get('http://www.fabpedigree.com/james/mathmen.htm')
>>> html = BeautifulSoup(raw_html, 'html.parser')
>>> for i, li in enumerate(html.select('li')):
        print(i, li.text)

0  Isaac Newton
 Archimedes
 Carl F. Gauss
 Leonhard Euler
 Bernhard Riemann

1  Archimedes
 Carl F. Gauss
 Leonhard Euler
 Bernhard Riemann

2  Carl F. Gauss
 Leonhard Euler 
 Bernhard Riemann

 3  Leonhard Euler
 Bernhard Riemann

4  Bernhard Riemann

# 5 ... and many more...
Posted by: Guest on August-09-2020

Code answers related to "python getting information from a web page"

Python Answers by Framework

Browse Popular Code Answers by Language