edgariyu 0 Posted December 8, 2010 Hi everione! To get the information that i want i have to fill a text box and then click the button. Apparently there's no problem, but the point is that the answer is showed dinamically on the page in a "div" that, before clicking the button was hide, and when i try to get the part of the page that i want with a _StringBetween function it doesn't works because doesn't find the new part of the HTML code that appears after the request. The is the code that i'm trying to use. I tried to use the function _IELoadWait, but it seems there's no efect... ;Includes ;================================================ #include <IE.au3> #Include <String.au3> ;================================================ ;Variables ;================================================ $URL="http://www.fib.upc.edu/fib/" $tool="http://whatlanguageisthis.com/" ; tool to use ;================================================ ;Inicio Script ;================================================ $WinHttpReq = ObjCreate("winhttp.winhttprequest.5.1") ;Realizamos la peticion HTTP $WinHttpReq.open("GET",$URL) $WinHttpReq.send() $HTML = $WinHttpReq.ResponseText ;Recuperamos el HTML de la web $titulo = _StringBetween($HTML,"<title","</title>") $header = _StringBetween($HTML,"<h1","</h1>") ConsoleWrite("el texto sera este: " & $titulo[0] & " " & $header[0] & @CRLF) $IE = _IECreate($tool) _IELoadWait($IE) $input = _IEGetObjById($IE,"input") _IEDocInsertText($input,$titulo[0]& " " & $header[0]) $boton = _IEGetObjById($IE,"analyze") _IEAction($boton,"click") _IELoadWait($IE,6000,6000) ; $result = _IEGetObjById($IE,"result") $language_s = _StringBetween($result,"<span id=language>","</span>") The page that i'm trying to deal with is "http://whatlanguageisthis.com/", that if you put some text in the text box and click in the button tells you what language the text belongs to. How can i get the name of the language that apears after processing the request?? It happens the same in other page i'm trying to get info, so i guess that the main question is how i can get info of a part of a HTML code that apears after a request is processed? because it seems that with comands like _IEDocReadHTML or _IEBodyReadHTML doesn't works. I would appreciate a lot your help!!! Thanks a lot in advance!!!!! Edgariyu Share this post Link to post Share on other sites
Tvern 11 Posted December 8, 2010 $result is an object, not a string. To get the text in that object, replace $language_s = _StringBetween($result,"<span id=language>","</span>") ;with $language_s = _IEPropertyGet($result,"innertext") Share this post Link to post Share on other sites
edgariyu 0 Posted December 8, 2010 Awesome Thank you so much Tvern!!!! Share this post Link to post Share on other sites