开发者

selenium python - assign value to a variable from web page

开发者 https://www.devze.com 2022-12-07 18:59 出处:网络
tried this method did not work how can i assign the value of an element from web page to a variable using selenium python in pycharm

tried this method did not work

how can i assign the value of an element from web page to a variable using selenium python in pycharm data structure

250

a=driver.get.element(By.ID,"rate").text()

250

a=driver.get.element(By.ID,"rate").inne开发者_StackOverflow社区rHTML()


Can you try using text instead of text()


driver = webdriver.Chrome(executable_path="D:\___\drivers\chromedriver_win32\chromedriver.exe", chrome_options=opt)

weight1 = driver.find_element(By.ID,"ContentPlaceHolder1_grd_Heads_lbl_NetWeight_0").text weight2 = float(weight1)

0

精彩评论

暂无评论...
验证码 换一张
取 消