Home>

I want to display the scraping result in the browser.

For example, if you scraped like this, how can you display it in a browser?

import requests
from bs4 import BeautifulSoup
html = requests.get (url)
soup = BeautifulSoup (html.content, "html.parser")
for element in soup.find_all (class_="_3S2Wdrkt1LKANaWcLrZToT"):
    print (element.text)

Thanks for your answers.

What I want to achieve is scraping the latest information and sharing it with several people, so I want to display it in the browser.

The environment is Mac, the browser is Google Chrome, Python3.7.9, anaconda, flask1.1.2.

The display on the terminal was possible.

I got advice that flask is good and installed it.

With reference to the explanation site, I was able to display "Hello world" in the browser in the local environment with the sample code, but I do not know what was scraped with the above code in the browser.

Trends