Skip to content
Advertisement

How to scrape dataframe after select options from dropdown list?

I want to scrape dataframe from dropdow value with BeautifulSoup.

  1. I select the value in both dropdown
  2. I submit my selection
  3. I get a data table

I would like to catch this dataframe with BS. any idea of the process to achieve this?

example site: https://coinarbitragebot.com/arbitrage.php

thanks

Advertisement

Answer

You can issue simple POST requests with custom parameters (the parameters you will see in Firefox/Chrome network tab when click Submit button). Then you can use pandas.read_html() function to get your DataFrame.

For example:

JavaScript

Prints:

JavaScript

EDIT:

To select only binance, bitfinex and bittrex, you can set data like this:

JavaScript

This will print:

JavaScript

If no arbitrage opportunity is found, no table is found (you will need to handle this case too probably).

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement