There is web page with exchange historical data: https://www.investing.com/indices/volatility-s-p-500-historical-data
Page contains dates-filter (range) and apply button (need to click on dates-range): <img1>
If I change date field via html picker and press "Apply" button - historical data updates perfectly. <img2>
But i want to update the page via Selenium webdriver. So the main thing I want to archive for now - update the page in Chrome dev tools, get old data.
What I try:
1 I open small modal with 2 dates via click after page load:
document.getElementsByClassName("flex flex-1 flex-col justify-center text-sm leading-5 text-[#333]")[0].nextSibling.click()
and see 2 date fields and "Apply" button.
[2] I set the input field value to new value (2022-01-01):
document.getElementsByClassName("absolute left-0 top-0 h-full w-full opacity-0")[0].value="2022-01-01";
<img3>
[3] I "click" the apply button:
document.getElementsByClassName("flex cursor-pointer items-center gap-3 rounded bg-v2-blue py-2.5 pl-4 pr-6 shadow-button")[0].click();
[4] .... GET request from page contains old data range so data does't update, but input field value is updated in [2])! <img4>
Whats wrong?
As I understand:
- There is 2 input fields id DOM ("from date" and "till date"):
<input class="absolute left-0 top-0 h-full w-full opacity-0" type="date" max="2024-03-29" value="2024-02-29"> - If we change that fileds values from html picker (.showPicker) - all works fine.
- If we change that fields values from Chrome dev tools (.value = "new date", see [2] above) - dont work.
So I can guess, that there is event, that fires only from html picker click. And that event stores in some place valid date-range (stored date-range is using in GET-request to background api).
I looked throught descr - no ideas :(
I checked cookies (I thought that date-range is stored here by hidden picker eventhandle) - no results. I checked "Event Listeners" tab in Chrome dev tools - no results (maybe I was looking in the wrong place/event or didnt understand info).
How can I set dates range from Chrome Dev Tools and receive historical data? Thank you and sorry, the great Web is not really my thing, I'm a C# backend developer :) All I need - get data to local DB via Selenium for some research.