Jump to content

Recommended Posts

Posted

Hi.

Is it possible to load a webpage then add some custom metadata for searching and then reload the same webpage and then use the result for further action and can it be done without showing the webpage?

I'm trying to search for specific trips on sas.se

Yours sincerely

Kenneth.

Posted (edited)

Right now, I don't have any code. I was just nosy to see is it was possible.

I was just thinking like as want to do with out any code:

  1. Open sas.dk
  2. Add my search criteria
  3. Reload sas.dk
  4. Do more code to find the trips I want. 

It seems you of course can use the Local $oIE = _IECreate("http://www.sas.dk"), but then you have the GUI.

 

So if this is possible, maybe I can be directed to the command that I start with load the webpage without any GUI.

 

Edited by Valnurat

Yours sincerely

Kenneth.

Posted
Posted

Here to start you up, you will need to read the values of the return criteria.

#include <IE.au3>

Local $sOrigin = "CPH", $sDest = "EWR", $sDepart = "20201112", $sReturn = "20201127", $iAdult = 2
Local $sURL = "https://www.sas.dk/book/flights?search=RT_" & $sOrigin & "-" & $sDest & "-" & $sDepart & "-" & $sReturn & "_a" & $iAdult & _
    "c0i0y0&view=upsell&bookingFlow=revenue&sortBy=stop,stop"
Local $oIE = _IECreate($sURL)

I use EWR since las doesn't seem to be a valid entry...

Posted

In connection with this I noticed that a popup is appearing before I can do more.

I would like to check if the "style" in green is "display: block;" then I need to press the OK button in the black arrow.

How is that done?

image.thumb.png.5d2e43937692ac43d272e7f7c6e9a94e.png

Yours sincerely

Kenneth.

Posted

It isen't much:

#include <IE.au3>

Local $sOrigin = "CPH", $sDest = "EWR", $sDepart = "20210116", $iAdult = 2
Local $sURL = "https://www.sas.dk/book/flights?search=OW_" & $sOrigin & "-" & $sDest & "-" & $sDepart & "_a" & $iAdult & _
    "c0i0y0&view=upsell&bookingFlow=points&sortBy=stop&filterBy=all"
Local $oIE = _IECreate($sURL)

 

Yours sincerely

Kenneth.

Posted

Here, but please next time, try to attempt something before asking for help. Thanks.

#include <Constants.au3>
#include <IE.au3>

Local $sOrigin = "CPH", $sDest = "EWR", $sDepart = "20210116", $iAdult = 2
Local $sURL = "https://www.sas.dk/book/flights?search=OW_" & $sOrigin & "-" & $sDest & "-" & $sDepart & "_a" & $iAdult & _
    "c0i0y0&view=upsell&bookingFlow=points&sortBy=stop&filterBy=all"
Local $oIE = _IECreate($sURL), $oWarn
For $i = 1 To 30
  Sleep(100)
  $oWarn = _IEGetObjById ($oIE,"got-it")
  If Not @error Then ExitLoop
Next
If Not IsObj($oWarn) Then Exit MsgBox ($MB_SYSTEMMODAL,"","Unable to get warning screen")
$oWarn.click()

That works for me...

Posted

Thank you.

I did, but it was not useful.

Can I ask what the $oWarn do in this, because I don't see that as an option in the help

Local $oIE = _IECreate($sURL), $oWarn

Yours sincerely

Kenneth.

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
×
×
  • Create New...