Remembering Where to Use Mechanical Soup
00:00 I want to mention a quick heads up that MechanicalSoup only works with a static website so HTML, you can’t use it for executing JavaScript. If your browser builds the page from a JavaScript source, then you won’t get far with MechanicalSoup and you’ll have to use other solutions such as Selenium, for example, which work with a headless browser and actually mimic a browser and execute JavaScript code to get to the page content that you’re looking for.
00:27
So this only works for HTML, and this is essentially a high-level interface for using requests
and BeautifulSoup
. But for pages like the one that you looked at now, it’s a great solution that is very elegant.
Become a Member to join the conversation.