Difference between revisions of "Python: Read URL"
Jump to navigation
Jump to search
Onnowpurbo (talk | contribs) |
Onnowpurbo (talk | contribs) |
||
Line 1: | Line 1: | ||
pip install requests | pip install requests | ||
− | pip install | + | pip install BeautifulSoup4 |
Script | Script |
Revision as of 08:34, 29 April 2019
pip install requests pip install BeautifulSoup4
Script
import requests from BeautifulSoup import BeautifulSoup link = "http://www.somesite.com/details.pl?urn=2344" f = requests.get(link) print(f.text)
soup = BeautifulSoup(f) all_text = .join(soup.findAll(text=True)) print(all_text)