Created
January 25, 2020 07:34
-
-
Save smrati/2a0f4de99f4d95f9fd0855357666aa07 to your computer and use it in GitHub Desktop.
MechanicalSoup Basic Tutorial
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import mechanicalsoup | |
user_agent_string = 'Mozilla/5.0 (X11; CrOS x86_64 8172.45.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.64 Safari/537.36' | |
browser = mechanicalsoup.StatefulBrowser(user_agent=user_agent_string, ) | |
browser.open('https://ebootcamp.dev') | |
headings_list = browser.get_current_page().find_all('h3') | |
for heading in headings_list: | |
print(heading.text) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment