问题
I'm currently new to both beautiful soup and geckodriver working on selenium 3. I am working on a project where I have to scrape URL from web pages.
I found that both of them are used for web scrapping, but could not get the difference between the two of them. What is the difference between BeautifulSoup and Geckodriver? Thanks for the help.
回答1:
BeautifulSoup is designed for web scraping.
a Python library for pulling data out of HTML and XML files. It works with your favorite parser to provide idiomatic ways of navigating, searching, and modifying the parse tree. It commonly saves programmers hours or days of work.
Geckodriver is a driver for Firefox, often for the purpose of testing in Selenium.
This program provides the HTTP API described by the WebDriver protocol to communicate with Gecko browsers, such as Firefox. It translates calls into the Firefox remote protocol by acting as a proxy between the local- and remote ends.
Selenium is often used to:
- create robust, browser-based regression automation suites and tests
- scale and distribute scripts across many environments
Selenium automates browsers. That's it! What you do with that power is entirely up to you. Primarily, it is for automating web applications for testing purposes, but is certainly not limited to just that. Boring web-based administration tasks can (and should!) be automated as well.
回答2:
I am just throwing more light on GeckoDriver
The implementation of Firefox Driver has been changed in Selenium 3.0. Starting with Firefox version 47.0+, we need to use separate a driver that will interact with the Firefox browser similarly to ChromeDriver. The new driver for Firefox is called Geckodriver.
The Geckodriver provides the HTTP API described by the W3C WebDriver Protocol to communicate with Gecko browsers, such as Firefox. It translates calls into the Firefox Remote Protocol (Marionette) by acting as a proxy between the local and remote ends.
Geckodriver releases can be tracked here
来源:https://stackoverflow.com/questions/51991181/what-is-the-difference-between-using-beautifulsoup-and-geckodriver-on-selenium