I am trying to use BeautifulSoup in this URL: https://es.investing.com/dividends-calendar/
My problem is that I want to set a specific dates to show. I saw in chrome network options what header is sending. But I had no luck getting the correct page, I am asking the URL for data from 01/01/2019 to 12/31/2020, but I always getting 2021 data.
This is what I tryed for now:
from bs4 import BeautifulSoup
import requests
from urllib.parse import parse_qsl
session = requests.Session()
session.headers.update({'User-Agent':'Mozilla/5.0'})
qs = 'country%5B%5D=26&dateFrom=2019-01-01&dateTo=2020-12-31¤tTab=custom&limit_from=0'
payload = dict(parse_qsl(qs))
html_text = session.post('https://es.investing.com/dividends-calendar/', data=payload).text
soup = BeautifulSoup(html_text,'lxml')
job = soup.find_all('table')
This qs is (I guess) the data from is sending to show the correct calendar range, this qs is what I got from Chrome Network Options.
Any idea what I am doing wrong??
Tanks a lot!
