Aug-23-2019, 04:27 PM
Is there any reason why you use selenium here?
If i test can get text without,should only use selenium if needed.
If i test can get text without,should only use selenium if needed.
import requests from bs4 import BeautifulSoup url = "http://www.correios.com.br/solucoes-empresariais/correios-facil" response = requests.get(url) soup = BeautifulSoup(response.content, 'lxml') texto = soup.find('div', class_="interna-01") first_p = texto.find('p')Test:
>>> first_p <p>Com as soluções de um grande operador logístico, a sua empresa pode se destacar e crescer ainda mais. Fortaleça seu negócio, tornando-se um parceiro dos Correios.</p> >>> print(first_p.text) Com as soluções de um grande operador logístico, a sua empresa pode se destacar e crescer ainda mais. Fortaleça seu negócio, tornando-se um parceiro dos Correios.
adnanahsan Wrote:It doesn't work on my serversWhat server are you running,are using a Python web-framework eg Flask,Django or something else?