Jump to content

Recommended Posts

Posted (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.

thumb_show.php?i=x3v9y37dk&view

 

This is the source code for my failed attempts, I wonder where I went wrong?

#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 by Melba23
Removed URL
Posted

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
Posted

beginner10,

Not going to help with that URL - thread locked.

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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

 

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...