Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Login to URL w/InitFromWeb
#1
Hi!
I try to read page on Amazon seller account:
Code:
Copy      Help
d.InitFromWeb("https://sellercentral.amazon.com/gp/orders-v2/list?ie=UTF8&useSavedSearch=default")
d.GetForm(0 s _s)
It will not deliver the target page but sends login page instead:
out _s
>>>>>>>
name=widgetToken
value=some_code_here
type=hidden

name=rememberMe
value=false
type=hidden

name=username
value=
type=text

name=password
value=
type=password

name=metadata1
value=bogus_stuff_here
type=hidden
<<<<<<<<<

Is there the way to login to the account and then get the page from web not from browser?
I am able to login thru browser win but this way Amazon only let me continuously read pages in browser only. That is hassle in my app.
I use IE and last versions of everything.
Thanks,
-vladi
#2
Try to login not in a web browser, but in a web browser control in the same process as the macro runs (QM or exe). Then the session probably will be valid when calling InitFromWeb.

Function Dialog193
Code:
Copy      Help
str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 302 172 "Dialog"
;3 ActiveX 0x54030000 0x0 0 0 300 170 "SHDocVw.WebBrowser {8856F961-340A-11D0-A96B-00C04FD705A2}"
;END DIALOG
;DIALOG EDITOR: "" 0x2040308 "*" "" "" ""

str controls = "3"
str ax3SHD
ax3SHD="https://sellercentral.amazon.com/gp/orders-v2/list?ie=UTF8&useSavedSearch=default"
if(!ShowDialog(dd 0 &controls)) ret
#3
Thank you, Gintaras!
It would be perfectly working if they did not make this page downloading (with js) in two steps for 'better experience'. First quckly shows first 6 order records. Then, beneath of displayed page it spins this [Image: loading-large_labeled._V192238949_.gif]
and in a few seconds, it loads the rest of page.
Is it possible to delay (extend) InitFromWeb for whole page to get in?
-vladi
#4
I don't know, try various ways.
For example, after InitFromWeb simply wait, or wait for some content in the page.
Macro Macro2696
Code:
Copy      Help
HtmlDoc d
d.SetOptions(2)
d.InitFromWeb("https://sellercentral.amazon.com/gp/orders-v2/list?ie=UTF8&useSavedSearch=default")
10
;or
;rep() 0.5; if(MyFunctionIfPageFullyLoaded(d)) break
Or even use dialog with web browser control, then wait for some accessible object in it which exists only when page fully loaded, then d.InitFromInternetExplorer(hwndWebBrowserControl).


Forum Jump:


Users browsing this thread: 3 Guest(s)