Jump to content

Recommended Posts

Posted

Hello AutoIt Forum,

I'm tyring to get a String from a Website.

The String I'm looking for is the one marked in blue:

image.thumb.png.abdeb5b0fa994cdee23360cba7ee0908.png

So far I only managed to get the sites source code, with this function:

;$URL = "http://localhost:8111/"

Func _HTTP_ResponseText($URL)
    $oHTTP = ObjCreate("winhttp.winhttprequest.5.1")
    $oHTTP.Open("GET", $URL, False)
    $oHTTP.SetRequestHeader("Content-Type","text/html; charset=UTF-8")
    $oHTTP.Send()

    return $oHTTP.ResponseText
EndFunc

However this only returns the source code, which does not contain the actual String data.

Theres got to be a way to link to the "hud-dmg-msg-root" ID, in order to get to the "textlines".

 

I must admit that I have no idea on how HTML works, I hope you can excuse that.

Thanks in advance.

  • Solution
Posted

Why you only get the original HTML

When you fetch a webpage’s source code (using View Source, curl, requests, etc.), you only receive the raw HTML sent by the server.
The browser then runs JavaScript, which modifies the DOM (for example: replacing XXX_YYY with translated text).
Because your code does not execute JavaScript, you cannot see the rendered text.


How to get the rendered HTML (after JavaScript runs)

You must use a tool that acts like a real browser and executes JavaScript:

Best options:

  • Playwright → fastest, modern, recommended

  • Puppeteer → great for Node.js

  • Selenium + ChromeDriver → traditional but slower

These tools load the page, run the JavaScript, and let you extract the fully rendered DOM.

Enjoy my work? Buy me a 🍻 or tip via ❤️ PayPal

  • Developers
Posted

Welcome to the AutoIt forum.

Unfortunately you appear to have missed the Forum rules on your way in. Please read them now - particularly the bit about not discussing game automation - and then you will understand why you will get no help and this thread will now be locked.

See you soon with a legitimate question I hope.

The Moderation team

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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

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