Безголовая строка парсера Chrome и HTML ⇐ Python
Безголовая строка парсера Chrome и HTML
I'm currently using selenium and BeautifulSoup to scrape a website but I'm running into two major issues, first of all, I can't get Chrome to launch in headless mode and it says there are multiple unexpected ends of inputs (photo of said errors). The other problem I have is that I keep getting an error on the line that contains "html.parser" saying that a 'str' is not a callable object. Any advice on these issues would be greatly appreciated thank you.
from selenium import webdriver from selenium.webdriver.chrome.options import Options import urllib.request import lxml import html5lib import time from bs4 import BeautifulSoup #config options options = Options() options.headless = True # Set the URL you want to webscrape from url = 'https://tokcount.com/?user=mrsam993' # Connect to the URL browser = webdriver.Chrome(options=options, executable_path='D:\chromedriver') #chrome_options=options browser.get(url) # Parse HTML and save to BeautifulSoup object soup = BeautifulSoup(browser.page_source(), "html.parser") browser.quit() # for i in range(10): links = soup.findAll('span', class_= 'odometer-value') print(links)
Источник: https://stackoverflow.com/questions/686 ... ser-string
I'm currently using selenium and BeautifulSoup to scrape a website but I'm running into two major issues, first of all, I can't get Chrome to launch in headless mode and it says there are multiple unexpected ends of inputs (photo of said errors). The other problem I have is that I keep getting an error on the line that contains "html.parser" saying that a 'str' is not a callable object. Any advice on these issues would be greatly appreciated thank you.
from selenium import webdriver from selenium.webdriver.chrome.options import Options import urllib.request import lxml import html5lib import time from bs4 import BeautifulSoup #config options options = Options() options.headless = True # Set the URL you want to webscrape from url = 'https://tokcount.com/?user=mrsam993' # Connect to the URL browser = webdriver.Chrome(options=options, executable_path='D:\chromedriver') #chrome_options=options browser.get(url) # Parse HTML and save to BeautifulSoup object soup = BeautifulSoup(browser.page_source(), "html.parser") browser.quit() # for i in range(10): links = soup.findAll('span', class_= 'odometer-value') print(links)
Источник: https://stackoverflow.com/questions/686 ... ser-string
-
- Похожие темы
- Ответы
- Просмотры
- Последнее сообщение