In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/03 Report--
/ / reference package import org.openqa.selenium.By;import org.openqa.selenium.WebDriver;import org.openqa.selenium.WebElement;import org.openqa.selenium.firefox.FirefoxDriver;public class TEST001 {public static void main (String [] args) {/ / browser path System.setProperty ("webdriver.firefox.bin", "D:/Firefox/firefox.exe") / * create a new browser driver / / here is the Firefox browser driver, other browser drivers refer to / / http://diaosi58.blog.51cto.com/2722311/1671998 documentation * / WebDriver driver = new FirefoxDriver () / / enter a connection driver.get to the browser input field ("http://huodong.12kaixue.net/s/0-v134.html"); / / get page button WebElement rush_btn = driver.findElement (By.id (" rush_btn ")); / / Click the button rush_btn.click () / / maximize the browser maxBrowser (driver); setScroll (driver,500); / / find the page floating DIV driver.findElement (By.className ("fl"). Click () / / find page floating DIV, account input box driver.findElement (By.xpath ("/ / input [@ id='username']"). SendKeys ("x986"); / / find page floating DIV, password input box driver.findElement (By.xpath ("/ / input [@ id='password']") .sendKeys ("a123456") / / find the page floating DIV, log in button, and click login driver.findElement (By.className ("submit-input")) .click (); / / close event driver.close () } private static void setScroll (WebDriver driver, int I) {/ / TODO Auto-generated method stub} private static void maxBrowser (WebDriver driver) {/ / TODO Auto-generated method stub}}
If you want to make the project loop, please add the loop statement. If you don't understand, please add me QQ:807002272 or email kasthjob@126.com.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.