NoizeBit

Setting date filter value

7 posts in this topic

#1 ·  Posted (edited)

Hi,

I've spent quite a few hours trying to figure out how to set up a filter to show only the current day's entries on a broker's site. Basically, if you visit the site the "To" field automatically shows today's date which is just fine. But it's a real headache to set the same value for the "From" field as well...

Any ideas how to set the same value there? The "To" field's input box is read-only and apparently doesn't have a value...
Clicking on the filter from button activates a popup content enabling to select the month and day, but I have no clue how to get it done :(

#include <IE.au3>

Global $oIE = _IECreate("https://www.24option.com/24option/#TradingHistory", 0, 1, 1, 0)

Sleep(3000)

$tags = $oIE.document.GetElementsByTagName("div")
For $tag In $tags
    $class_value = $tag.GetAttribute("class")
    If $class_value = "trading_history_dates_filter_from_button" Then
        $tag.click()
        ExitLoop
    EndIf
Next

Above is the code so far. Any help or advice is much appreciated as always :)

Edited by NoizeBit

Share this post


Link to post
Share on other sites



Why you Need this?

What do you want to do with this?

Some questions which maybe the MVP would ask~


  • C++/AutoIt/OpenGL Easy Coder
  • I will be Kind to you and try to help you
  • till what you want isn't against the Forum
  • Rules~

 

Share this post


Link to post
Share on other sites

@RaiNote - Take it easy, there's nothing alarming here.

@NoiseBit - Patience, someone facile with IE (which excludes ne) will be along sooner or later. 

kylomas

1 person likes this

Forum Rules         Procedure for posting code

"I like pigs.  Dogs look up to us.  Cats look down on us.  Pigs treat us as equals."

- Sir Winston Churchill

Share this post


Link to post
Share on other sites

@RaiNote - Take it easy, there's nothing alarming here.

@NoiseBit - Patience, someone facile with IE (which excludes ne) will be along sooner or later. 

kylomas

@RaiNote - I understand it might look suspicious to some, but I only want to set a proper filter to be able to download a trading history report in csv.

@kylomas - Thanks, I hope someone might have came across something like this and have an idea on how to proceed.

Share this post


Link to post
Share on other sites

Maybe you can try to set the value in the input directly :

For $tag In $tags
    If $tag.className = "trading_history_dates_filter_from trading_history_dates_filter_from-readonly" Then $tag.value = "2015 Aug 10"
Next

Also click on the input seems to do what you want, so :

If $tag.className = "trading_history_dates_filter_from trading_history_dates_filter_from-readonly" Then _IEAction($tag, "click")

 

Share this post


Link to post
Share on other sites

Maybe you can try to set the value in the input directly :

For $tag In $tags
    If $tag.className = "trading_history_dates_filter_from trading_history_dates_filter_from-readonly" Then $tag.value = "2015 Aug 10"
Next

Also click on the input seems to do what you want, so :

If $tag.className = "trading_history_dates_filter_from trading_history_dates_filter_from-readonly" Then _IEAction($tag, "click")

 

There's a reason why it's called read-only B)

Clicking on it only brings up the calendar meaning it has the same effect as clicking on the button next to it...

 

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

Just found out that no matter what filter I set up it doesn't apply to the exported csv file, so it will always contain all the records, so I'll have to remove the lines from the file by some method...

Thanks anyway :>

Edited by NoizeBit

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now