作业:使用selenium获得数据并整理到csv表格中
import csv
import os
import re
from tqdm import tqdm
from bs4 import BeautifulSoup
from selenium.webdriver import Chrome, ChromeOptions
from selenium.webdriver.common.keys import Keys
from time import sleep
from random import random
def options_change():
options = ChromeOptions()
options.add_experimental_option('excludeSwitches', ['enable-automation'])
options.add_experimental_option("prefs", {
"profile.managed_default_content_settings.images": 2})
return options
def create_file(path, head):
if not os.path.exists(path):
writer = csv.writer