Home > Software engineering >  Why use the browser can access to the site and use VBA programming is forbidden by its access
Why use the browser can access to the site and use VBA programming is forbidden by its access

Time:09-23

There was a time I used the following VBA program can access to the "http://xueqiu.com/cubes/rebalancing/history.json? Cube_symbol=ZH651290 & amp; The count=20 & amp; Page=1 "site data, the code is as follows:
 With CreateObject (" MSXML2. ServerXMLHTTP ") 
. Open the "post", "http://xueqiu.com/cubes/rebalancing/history.json? Cube_symbol="& amp; Ws1. Cells (1, 8) & amp; "& amp; The count=20 & amp; Page=1 ", False

. Send
While the readystate & lt;> 4
DoEvents
Wend
Web_content=. The responseText
End With

//////////////////but now access is only "403 Forbidden. Your IP Address: 112.82.160. * *."
And I can use a browser to enter url or return data "{" count" : 20, "page" : 1, "totalCount" : 813, "a list" :,,, at the back of the omitted, "
This is what circumstance? Don't website can detect the way I access it, stop I use a program to access, ask tall person to give directions,

CodePudding user response:

Tools, options, security, macro security, security level: low, sure,
Try it.

CodePudding user response:

Tools, options, security, macro security, reliable distributors, faith in the access of "Visual Basic project",
Try it.

CodePudding user response:

Not a macro problem, other macro software running normal, my program sina web data without any problems

CodePudding user response:

This is to use the XMLHTTP
His visit format is different from ordinary
Because there is no some browser information
So the server can easily tell
You can forge the browser information
Or use WEBBROWER directly to collection

CodePudding user response:

I logged in the web page you
Found an error
{" error_description ":" encounters an error, please refresh the page or try again after login account ", "error_uri" : "/cubes rebalancing/history. Json", "error_code" : "400016"}
Can you give a I give you see
Estimation is refer to simulate the browser

CodePudding user response:

Some website is not support the web access, that is about to simulate adding headers, reference page, UA, etc
  • Related