python爬取东方财富网历史资金流向(存入MySQL)
from selenium import webdriver #导入模块,selenium导入浏览器驱动,用get方法打开浏览器
import time
import re
import csv #存储数据
from lxml import etree #数据的解析
import pandas as pd
import numpy as np
option = webdriver.ChromeOptions() #网址获取
option.add_argument('headless') #无界面启动,即设置浏览器静默
driver = webdriver.Chrome(options=option)
driver.get('http://data.eastmoney.com/zjlx/000040.html')
table=driver.find_element(By.ID,'table_ls')
# data_heads1=table.find_elements(By.TAG_NAME,'th')[:8]
# data_heads2
共有 0 条评论