In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/03 Report--
1 controls the size of the browser window
Driver.set_window_size (480480) Code: from selenium import webdriverfrom time import * driver = webdriver.Chrome () url = "http://www.baidu.com"driver.get(url)print(" sets the width and height of the browser") driver.set_window_size (480480) sleep (3) print ("set window maximization") driver.maximize_window () sleep (3) driver.quit ()
two。 Control browser backward, forward back and forward methods
From selenium import webdriverfrom time import * driver = webdriver.Chrome () url = "http://www.baidu.com"print('new access% s'% (url) driver.get (url) url2 = 'http://news.baidui.com'print('new access% s'% (url2)) driver.get (url2) sleep (3) print (" back to% "% (url)) driver.back () sleep (3) print (" forword to% s "% (url2)) ) driver.forward () sleep (3) driver.quit ()
3. Simulate the refresh of the browser
Manually refresh the (F5) page: driver.refresh ()
From selenium import webdriver
From time import *
Driver = webdriver.Chrome ()
Url = "http://www.baidu.com"
Print ('new access% s'% (url))
Driver.get (url)
Sleep (3)
Driver.refresh ()
Sleep (3)
Driver.quit ()
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.