In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly explains "how to build a Selenium environment". The content of the article is simple and clear, and it is easy to learn and understand. Please follow the editor's ideas to study and learn "how to build a Selenium environment".
01
What is Selenium?
I believe that students engaged in automated testing or those who have experienced Python crawler will know what Selenium is.
Selenium is a Web automated testing software, as the Selenium official website said: Selenium is mainly for testing purposes and automation of Web applications, but of course not limited to this, some boring Web-based management tasks can also be automated using Selenium. Yeah, like reptiles.
Web crawler should be the most well-known application scenario of Selenium in addition to Web automated testing. It can effectively obtain the data on the page when facing some dynamic web pages generated by JS. It can be said to be a must-have product for Python web crawlers.
02
Install Selenium in Python
Selenium provides the interface of Python for us to use Selenium, and through concise API, we can use all the functions of Selenium in Python.
We can download Selenium's Python installation package to install it, but it is easier to install it using the pip tool:
Pip install selenium
Enter the shell of Python to test whether selenium can be successfully import:
This completes the installation of selenium.
03
Download browser driver
Selenium requires a browser driver (webdriver) to connect and launch a browser. If you use Firefox, you need geckodriver;. If you use Chrome, you need chromedriver.
Here, we choose Google's Chrome browser as the demo, so we need to download chromedriver.
On Taobao's open source package management site: http://npm.taobao.org/mirrors/chromedriver/ chooses the appropriate chromedriver version according to the version of the Chrome browser on its computer. Generally speaking, if the Chrome browser is the latest version, then select chromedriver 2.37:
Click in and choose a different version of the operating system according to your computer:
Here, I use a computer with Windows system, so I choose "chromedriver_win32.zip".
After downloading, unzip it:
In this way, we downloaded the browser driver. If you need to use another browser, you can also download it from http://npm.taobao.org/mirrors/:
Thank you for your reading, the above is the content of "how to build Selenium environment", after the study of this article, I believe you have a deeper understanding of how to build Selenium environment, the specific use of the situation also needs to be verified by practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
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.