Skip to content
Advertisement

python web scraping issues with mechanize

I am trying to scrape web results from the website: https://promedmail.org/promed-posts/

I have followed beutifulsoup. mechanical soup and mechanize so far unable to scrape the search results.

JavaScript

The content does not show the search results when typed in US. Any idea on what am I doing wrong here?

Advertisement

Answer

As you mention bs4 you can mimic the POST request the page makes. Extract the json item which contains the html the page would have been updated with (containing the results); parse that into BeautifulSoup object then reconstruct the results table as a dataframe:

JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement