Jump to content

Recommended Posts

Posted (edited)

Hi,

I am having problems trying to retrieve the code HTML from a website. the letters with accents and the letter ñ don´t show well. For example,

I see this: Guía local de comercios en Argentina - Guía Local

and I would have to see this: Guía local de comercios en Argentina - Guía Local.

It happens with all the text html.

I am using winhttp udf. What I can do? Any idea?

My code:

#include <WinHTTP.au3>
$hOpen = _WinHttpOpen()
$hConnect = _WinHttpConnect($hOpen, "guialocal.com.ar")
$html = _WinHttpSimpleRequest($hConnect, "get")
ConsoleWrite($html)
; Close handles
_WinHttpCloseHandle($hConnect)
_WinHttpCloseHandle($hOpen)
Edited by Chefito
Posted

#include <WinHTTP.au3> seems to handle no codepages.

#include <ie.au3> works fine.

Run the following code and see the resulting messagebox.

#include <WinHTTP.au3>
$hOpen = _WinHttpOpen()
$hConnect = _WinHttpConnect($hOpen, "guialocal.com.ar")
$html = _WinHttpSimpleRequest($hConnect, "get")
ConsoleWrite($html)
; Close handles
_WinHttpCloseHandle($hConnect)
_WinHttpCloseHandle($hOpen)
$title1 = _StringBetween($html, "<title>", "</title>")

#include <ie.au3>
#include <string.au3>
$oIE = _IECreate("guialocal.com.ar", Default, 0)
$html = _IEDocReadHTML($oIE)
ConsoleWrite($html)
_IEQuit($oIE)
$title2 = _StringBetween($html, "<title>", "</title>")
MsgBox(262144, " Titles ", $title1[0] & @LF & $title2[0])

App: Au3toCmd              UDF: _SingleScript()                             

Posted

Exit, thank, but it isn't that I want to do. Also, I don't want to use the ie.au3 udf. I could do it for example with _iebodyreadtext, but I want to know as it do with winhttp.

Thank you very much ;).

Trancexx, I have read many post from you and I know that you are a genius ;).

Your solution works perfectly!!!!! :). I was that I wanted. I never would have guessed it was that parameter. Thank you very very much.

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
×
×
  • Create New...