您的当前位置:首页正文

selenium 刷新

2024-11-30 来源:个人技术集锦

java

1.driver.navigate().refresh();
2.driver.get(driver.getCurrentUrl());
3.driver.navigate().to(driver.getCurrentUrl());
4.driver.findElement(By.id("Contact-us")).sendKeys(Keys.F5); 
5.driver.executeScript("history.go(0)");

In python

Using built in method

driver.refresh()

or, executing JavaScript

driver.execute_script("location.reload()")



显示全文