mHelpMe
mHelpMe

Reputation: 6668

scraping data from web page but missing content

I am downloading the verb conjugations to aid my learning. However one thing I can't seem to get from this web page is the english translation near the top of the page.

The code I have is below. When I print results_eng it prints the section I want but there is no english translation, what am I missing?

import requests
from bs4 import BeautifulSoup

URL = 'https://conjugator.reverso.net/conjugation-portuguese-verb-ser.html'
page = requests.get(URL)
soup = BeautifulSoup(page.content, 'html.parser')
results_eng = soup.find(id='list-translations')
eng = results_eng.find_all('p', class_='context_term')

Upvotes: 0

Views: 37

Answers (1)

martin
martin

Reputation: 885

In a normal website, you should be able to find the text in a paragraph witht the function get_text(), but in this case this is a search, wich means it's probably pulling the data from a database and its not in the paragraph itself. At least that's what I can come up with, since I tried to use that function and I got an empty string in return. Can't you try another website and see what happens?

p.d: I'm a beginner, sorry if I'm guessing wrong

Upvotes: 1

Related Questions