Is this normal?


#1

question:
https://github.com/ariya/phantomjs/issues/13886#issuecomment-171477473

thanks


#2

Yes, this is normal behavior. Your script clicked on a regular old HTML hyperlink. That always causes a new page to be loaded and the DOM to be recreated from scratch - the only exception is when it’s a link to a “fragment” (<a href="#element-id">) within the current page.


#3

Thank you very much for your answer.
but,when i change my test html :

<!doctype html>
<html lang="en">
<body>
    <a id="mya" href="http://localhost:8088/test123.html">test</a>
    <input type='text'></input>
</body>
</html>

here is output:

1 onNavigationRequested:http://localhost:8088/
1 onResourceRequested:http://localhost:8088/
<body>
<a id="mya" href="http://localhost:8088/test123.html">test</a>
<input type="text">

</body>
2 onNavigationRequested:http://localhost:8088/test123.html
2 onResourceRequested:http://localhost:8088/test123.html
<body>
<a id="mya" href="http://localhost:8088/test123.html" crawl_mark="staged">test</a>
<input type="text">

</body>
3 onNavigationRequested:http://localhost:8088/test123.html
3 onResourceRequested:http://localhost:8088/test123.html

what is mark ‘crawl_mark=“staged”’ is still here, dom is not reloaded, so why?
thanks.