我试着从"Economia"部分的这个web page中获得这个值:
我想要得到所有的头衔.这是我当前的代码:
html = client.get("http://larepublica.pe/")
soup = BeautifulSoup(html.text, 'html.parser')
# Obtener la noticia de portada principal
economyNews = ""
for div in soup.findAll('h2', attrs={'class':'ItemSection_itemSection__title__PleA9'}):
n = div.text
economyNews += n+"\\n"
print(economyNews )
我已经测试了很多方法来获得这个,但似乎网页锁定了这个. 任何解决这个问题的 idea ,伙计们,我都会很感激的.非常感谢.