Jump to content
Sign in to follow this  


Recommended Posts

#include <String.au3>

$source = BinaryToString(InetRead("http://www.imdb.com/chart/top"))

$string_arr = _StringBetween($source, '(dir.),','<span class="secondaryInfo">')

For $i in $string_arr
    $title = _StringBetween($i, ">", "</a>")
    ConsoleWrite($title[0] & @CRLF)

this script is supposed to go to IMDb website, collect the names of top 250 rated movies, and write their names to console.

It works fine, except for one thing, it writes the names of movies in my language, and I want it to write them in English

English is set as default language for all my browsers, so I guess is has to do something with AutoIt preferences! 

Anyone experienced something similar?


Share this post

Link to post
Share on other sites

InetRead is fine for basic use, but winhttprequest is better for something like this

; Creating the object
$oHTTP = ObjCreate("winhttp.winhttprequest.5.1")
$oHTTP.Open("GET", "http://www.imdb.com/chart/top", False)
$oHTTP.SetRequestHeader("Accept-Language", "en")

; Performing the Request

; Download the body response if any, and get the server status response code.
$oReceived = $oHTTP.ResponseText
$oStatusCode = $oHTTP.Status

FileWrite("imdb.html", $oReceived)


Edited by genius257

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this