Yi's Blog

Yi's blog

马上订阅 Yi's Blog RSS 更新: https://wangyi.ai/atom.xml

Minimum Selenium Tutorial

2020年1月14日 15:48

Selenium is an umbrella project for a range of tools and libraries that enable and support the automation of web browsers. In my own words, it’s a solution for you to manipulate a browser in scripts.

As you can imagine, this can be useful in many ways. In tech companies, this is used to test web pages. For personal projects, we can use it to crawl some information which is hard to query directly.

There are quite a few programming languages supported to write Selenium scripts. Here in this tutorial, I will use Java. As a minimum Selenium tutorial, CodeRunner, which means the native macOS application, not the VS Code extension, will be used instead of a completed IDE.

First, download ChromeDriver from this Google site, which is a binary file, and save it somewhere for future usage. Please pay attention to the version you are downloading, as you will need the exact version as your Chrome assuming that you have already had Chrome installed.

Secondly, download Java Selenium Client from Selenium’s website.

-w1073

After uncompress, it should looks like this:

-w615

The last step, open up a new CodeRunner tab with Java as the selected language. Copy and paste...

剩余内容已隐藏

查看完整文章以阅读更多