Home > Net >  Simulation access web page how to read after js perform value
Simulation access web page how to read after js perform value

Time:09-15

Why I use HttpWebRequest, WebClient, even the WebBrowser request page, also can't read the web page js results after running? Or my method is wrong?
The following: how do I read onl oads (after) to the value of the box?

 
& lt; html>
& lt; head>


& lt; Script language="JavaScript" type="text/JavaScript" & gt;
Var box="";

The function onl oads () {
Var ()
b=XXXBox=b.b ox;
Document. The getElementById (' box '). value=https://bbs.csdn.net/topics/box;
Document. The getElementById (' iov) action=webProtocal + + webDomain "://" + "/aa. PHP";
Document. The getElementById (' iov). Submit ();
}
& lt;/script>

& lt;/head>
& lt; The body onl oad="onloads ();">
& lt; Form id="iov" name="iov" action="method=" POST target='iFrame' & gt;
& lt; Input type="HIDDEN" id="box" name="box" value="" & gt;
& lt;/form>
& lt;/body>

& lt;/html>

CodePudding user response:

WebClient HttpWebRequest, is HTML text content, JS right now is just one of the text, the WebBrowser cannot normal execution of the script, may be an error, and you didn't open the WebBrowser errors,

CodePudding user response:

reference 1st floor icoolno1 response:
HttpWebRequest, WebClient got the HTML text content, JS right now is just one of the text, the WebBrowser cannot normal execution of the script, may be an error, and you didn't open the WebBrowser error,

You mean if WebBrowser can perform normally?

CodePudding user response:

Your address was wrong

CodePudding user response:

Do you want to request the post after the address and then parse the returned data content

CodePudding user response:

WebBrowser should be allowed, unless the script is not compatible with ie kernel

CodePudding user response:

Normally we want that after "results" F12 scratch my first request typically see their request parameters. Information such as format.

Then use the code to simulate sending HTTP requests to the actual value

CodePudding user response:

1. Ensure the js and correct
2. Give the WebBrowser time. After all, load, also need time, we all use hbir plan now knows that customer complaints of favorite point load is so "bad" for a while

CodePudding user response:

HttpWebRequest, WebClient request back is a pile of data, including embedded inside js script.
The script code is to perform after the page loads, and the other two request return data in the browser environment or other technology is under the blessing of a pile body without soul.
WebBrowser requests, executes the code in the script, but if you want to get the result of the execution, must after execution to obtain or use technical means to manually perform the js script, of course, performed manually, you can also use the former two methods, get access to content, take out the inside of the js script, use js parsing engine (such as V8) to perform and get the result of the data.

CodePudding user response:

Normally,
You check the PhantomJS right, I with his success after grilled js performs page face value,

CodePudding user response:

Finally found that can be a WebBrowser compatibility, I use IE to access complains, use Google browser to access is not an error, could you tell me what can take the place of take that? Can read js operation result is ok!
  •  Tags:  
  • C#
  • Related