Posts: 100
Threads: 45
Joined: Jan 2014
Hi guys,
Is there a way of login a website using InitFromWeb?
I need to get a info from the site below, but it demands User and Password.
Macro
Macro6
HtmlDoc d
d.SetOptions(2)
d.InitFromWeb("https://www.quandl.com/sign-up-modal")
Posts: 12,074
Threads: 141
Joined: Dec 2002
06-21-2019, 05:40 AM
(This post was last modified: 06-21-2019, 05:41 AM by Gintaras.)
Try to login manually using a dialog with a web browser control.
For example, this macro is for this forum, gets the User CP page.
Macro
Macro296
out
;retry
HtmlDoc d
d.SetOptions(2)
d.InitFromWeb("http://www.quickmacros.com/forum/usercp.php")
str s=d.GetText
out s
if find(s "You are either not logged in")>=0
,if(!DialogWithWebBrowserControl("http://www.quickmacros.com/forum/")) ret ;;in this page login manually. If there is a checkbox like "Remember me", let it be checked.
,goto retry
;...
Function
DialogWithWebBrowserControl
function! $url
str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 696 376 "Dialog" "4"
;3 ActiveX 0x54030000 0x0 0 0 696 350 "SHDocVw.WebBrowser {8856F961-340A-11D0-A96B-00C04FD705A2}"
;1 Button 0x54030001 0x4 8 356 48 14 "OK"
;2 Button 0x54030000 0x4 64 356 48 14 "Cancel"
;END DIALOG
;DIALOG EDITOR: "" 0x2040802 "*" "" "" ""
str controls = "3"
str ax3SHD
ax3SHD=url
ret ShowDialog(dd &sub.DlgProc &controls)
#sub DlgProc
function# hDlg message wParam lParam
sel message
,case WM_INITDIALOG
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
ret 1
Posts: 100
Threads: 45
Joined: Jan 2014
You are outstanding, man!
Thanks a lot!