beginner10 Posted March 14, 2022 Posted March 14, 2022 (edited) Hi, I need a little help, if anyone is willing to help me, I rarely post on the forum here, I usually try to learn on my own, but now, I have not found a solution to my problem, although I tried for a few weeks alone. I need to find in the source code of a page, the list of users, as it is in the picture attached below. This is the source code for my failed attempts, I wonder where I went wrong? expandcollapse popup#include <Array.au3> #include <String.au3> $oMyError = ObjEvent("AutoIt.Error", "MyErrFunc") $url = "#########################" ; Replace this link with an online model $Get = BinaryToString(InetRead($url, 1), 4) ;ConsoleWrite(@CRLF & $Get) $Get2 = WinHttp_read($url) ConsoleWrite(@CRLF & $Get2) ClipPut($Get2) Exit Func WinHttp_read($url) $oHttp = ObjCreate("WinHttp.WinHttpRequest.5.1") $oHttp.Open("GET", $url, False) $oHttp.SetRequestHeader("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.82 Safari/537.36") $oHttp.SetRequestHeader("Pragma", "no-cache") $oHttp.SetRequestHeader("Cache-Control", "no-cache") $oHttp.SetRequestHeader("Referer", "########################") $oHttp.SetRequestHeader("Cookie", 'agreeterms=1') $oHttp.Send() If @error Then Return SetError(5, "", "") $oHttp.WaitForResponse() $HTMLSource = $oHttp.Responsetext $cookiesg = $oHttp.GetAllResponseHeaders() $oHttp = 0 Return $HTMLSource $oHttp.Close EndFunc ;==>WinHttp_read After testing with the first default function, InetRead, I realized that the problem is that the page is not fully loaded, and I started using WinHttp. I had some hopes with WinHttp, I used User-Agent and WaitForResponse (), but still I don't get all the source code to find the list of users in it. If you can help me with some ideas at least, I would be grateful Thank you in advance. Edited March 14, 2022 by Melba23 Removed URL
beginner10 Posted March 14, 2022 Author Posted March 14, 2022 I searched more closely and it seems that the $oHttp.SetRequestHeader("Cookie", 'test=testcookie') function is not working. Because $oHttp.GetAllResponseHeaders() does not include my cookie set.
Moderators Melba23 Posted March 14, 2022 Moderators Posted March 14, 2022 beginner10, Not going to help with that URL - thread locked. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Reveal hidden contents ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
Recommended Posts