Ask the experts: How to solve the garbled problem of downloading data from this website?I downloaded the website data according to the following script, and the result was garbled.
Although I have added language encoding.
Thanks!
u="http://basic.10jqka.com.cn/600000/equity.html";d1=Open(u,HTML Table(3,Column Names(1),Data Starts(2)),Charset("gb2312"));


Automation and ScriptingRe: 请教专家:怎样解决下载这个网站数据的乱码问题?try something like this
u="https://www.w3schools.com/html/html_tables.asp";
blobdata = loadtextfile(u,blob);
//blobdata=blobpeek(blobdata,0,47939)||hextoblob("20CDE2")||blobpeek(blobdata,47939);// insert 外 https://en.wikipedia.org/wiki/GB_2312
chardata = blobtochar(blobdata,"gb2312");
filename = savetextfile("$temp/deleteme.html",chardata);
d1=Open(filename,HTML Table(1));
Download the data as a blob.
Convert the blob to character data using the GB2312 encoding.
Save the character data; it will be UTF8 encoding on disk.
Open the saved file.
the blobpeek offset was chosen very carefully to but the character here.the blobpeek offset was chosen very carefully to but the character here.the blobpeek offset was chosen very carefully to but the character here.the blobpeek offset was chosen very carefully to but the character here.the blobpeek offset was chosen very carefully to but the character here.the blobpeek offset was chosen very carefully to but the character here.
Re: Ask the experts: How to solve the garbled problem of downloading data from this website?Thanks to the experts!
I tried to modify it, but it can't be downloaded

Re: Ask the experts: How to solve the garbled problem of downloading data from this website?Thanks to all the experts!
Strange, I tried the same code today and it worked, but the result is still garbled

Re: 请教专家:怎样解决下载这个网站数据的乱码问题?u="http://basic.10jqka.com.cn/600000/equity.html";
txt = loadtextfile(u,blob);<BR />
它不工作。谢谢!
Re: 请教专家:怎样解决下载这个网站数据的乱码问题?There might be a translation problem.
I think you are saying it did not work.
I am guessing it needs a user name and password.
If I am wrong, you'll need to give me more information.
Here's how you can supply a basic auth password.
You might need to use https instead of http.
//u = "http://basic.10jqka.com.cn/600000/equity.html";
u = "https://www.w3schools.com/html/html_tables.asp";
blobdata = New HTTP Request(
URL( u ),
Method( "GET" ),
Username( "ross" ),
Password( "Abc123" )
) << Send( "blob" );
chardata = Blob To Char( blobdata, "gb2312" );
filename = Save Text File( "$temp/deleteme.html", chardata );
d1 = Open( filename, HTML Table( 1 ) );