我查看了类似问题提供的答案,但我无法找到解决问题的方法。
我想在由chrome中的扩展程序生成的交互式图表中绘制日期和价格。我设法通过检查页面找出正在绘制的点,但问题是当光标移动到该点时出现的细节(日期和价格)。我怎样才能抓住这些细节?
扩展网址如下:
https://chrome.google.com/webstore/detail/buyhatke/jaehkpjddfdgiiefcnhahapilbejohhj?hl=en
目前我设法安装了扩展程序并点击价格图表。 我的代码:
from selenium import webdriver
import time
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
chrome_options = Options()
chrome_options.add_argument('load-
extension=C:\\Users\\SACHIN\\AppData\\Local\\Google\\Chrome\\User
Data\\Default\\Extensions\\jaehkpjddfdgiiefcnhahapilbejohhj\\3.4.141_0')
driver = webdriver.Chrome(chrome_options=chrome_options)
driver.implicitly_wait(30)
driver.get("https://paytm.com/shop/p/samsung-j3-pro-16-gb-black-MOBSAMSUNG-J3-PSTPL5914255C1B4E1C?src=grid&tracker=curated%7C%7Cmobile%20phones%7CCategory%20Grid%7C%2Fg%2Fmobile-accessories%2Fmobiles%2Fsmart-phones%7C66781%7C1%7C")
element=driver.find_element_by_xpath("//*[@id=\"hk-killerDIV\"]/div/div[5]/div[1]/div[3]")
element.click()
我真的不知道如何处理光标在点上移动时产生的日期和价格。