I am trying to scrape some data from the link: https://turnbackhoax.id/ but it doesn’t work.
I have tried before to use BeautifulSoup with other website and it worked. Can you help me. The code is the following:
data = []
for page in range(1, 110):
if page == 1:
url = "https://turnbackhoax.id/?s=covid-19"
else:
url = "https://turnbackhoax.id/page/" + str(page)
req = requests.get(url)
soup = BeautifulSoup(req.text, "html.parser")
column = soup.findAll("article")
for scraping in column:
text = scraping.find("h2", "title").text.strip().split("n")
kategori = scraping.find("span", "category")
link = scraping.find("a")["href"]
print(text, kategori, link)
New contributor
Niar Yuniarti is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
2