学习强国爬虫 搜索+文章内容
This commit is contained in:
@@ -20,7 +20,7 @@ from selenium.webdriver.support import expected_conditions as EC
|
||||
from selenium.webdriver.chrome.options import Options
|
||||
from selenium.webdriver.common.action_chains import ActionChains
|
||||
from selenium.webdriver.chrome.service import Service
|
||||
|
||||
import platform
|
||||
import time
|
||||
import random
|
||||
import os
|
||||
@@ -126,7 +126,12 @@ class XhwCrawler(BaseCrawler):
|
||||
chrome_options.add_argument('--disable-web-security')
|
||||
chrome_options.add_argument('--allow-running-insecure-content')
|
||||
chrome_options.add_argument('--disable-features=VizDisplayCompositor')
|
||||
service = Service(executable_path=r"chromedriver.exe")
|
||||
chrome_driver_path = 'win/chromedriver.exe'
|
||||
|
||||
if platform.system() == 'Linux':
|
||||
chrome_driver_path = 'linux/chromedriver'
|
||||
|
||||
service = Service(executable_path=chrome_driver_path)
|
||||
|
||||
driver = None
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user