If the above code runs successfully on your computer, you should see your browser pops out. Let’s move on.
Step 2. Open a website
Under the above code, add thess lines:
You should see Zillow is opened in your browser. Note: Using web scrapper on Zillow is against Zillow’s terms. It is only used for demonstration here.
Step 3. Input
Now we want to automatically have something input to the website.
You should see the searching box is filled with ‘10001’. Note: “react-autosuggest__input” is the class name of the input box, which you can find through right clicking on the input box and then click “inspect element”.\
Then use the following command to enter the search.
For a complete list of Keys available, refer to Selenium api.
Step 4. Click a button
Say if we want to click on a button, e.g. next page.
You will be taken to next page.
Notes:
To be continued
The remaining part will be using BeautifulSoup to parse the web information. This will be a relatively easy task.
Visiting Zillow so frequently will be tested by CAPTCHA.
For more information, refer to this repo where I learned web scrapper from, but note that the code there is out-of-date.