开发者

Form submit simulation - Javascript menu

I'd like to get conte开发者_StackOverflow中文版nts of a website using JavaScript menu. I need to simulate clicks (or typing javascript:gotoPage("p10"); into a browser) on menu links to be able to move from one page to another. The website uses a form activated by JS. It's probably not possible to go to another page by entering URL, because there are some hidden fields (something like hash- it's dependent on time and the page #). That's why I have to simulate a browser using user.

Basically the process will look like this: while (any_content) { file_get_contents(); clickalink(); }

Can cURL or JSON be used for this task?


If you're using PrototypeJS you could perhaps use the event.simulate library to simulate clicks on links.

https://github.com/kangax/protolicious/blob/master/event.simulate.js

$('link_id').simulate('click');
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜