![60e6ed0c7fb25665ec77df4490379ebc.png](https://img-blog.csdnimg.cn/img_convert/60e6ed0c7fb25665ec77df4490379ebc.png)
马上要离职了,天天在单位闲出屁,但是又不好明目张胆,就默默开始搜寻上班摸鱼技能,嘿,还真被我找到了。。。
天天抱个手机看股票也不是个办法,各位老师们给的现成的代码都是爬取盘后数据,这种,我公众号里面现成的一大堆,连自己跑代码的过程都省去了,最后只能自己动手丰衣足食咯
=。=(代码里面有很多是没啥用的,也懒得删了)
import re
import time
from urllib.parse import quote
from selenium import webdriver
global stoList,stoList_quote
stoList = []
stoList_quote = []
# 价格获取函数
def get_price(browser):
num1 = browser.find_element_by_xpath('/html/body/div[3]/div/div[2]/div[4]/div[2]/div[1]/span[1]')
price = num1.text
# print(price)
return price
# 涨跌额获取函数
def get_amount(browser):
num2 = browser.find_element_by_xpath('/html/body/div[3]/div/