开发者

Using php curl to automate website. [duplicate]

This question already has answers here: 开发者_StackOverflow中文版 Closed 11 years ago.

Possible Duplicate:

Is there a PHP equivalent of Perl's WWW::Mechanize?

Anyway to do this with curl php?

  import mechanize
  br=mechanize.Browser()
  br.open('https://www.google.com/calendar/exporticalzip')
  br.select_form(nr=0)
  br['Email']='Username@gmail.com'
  br['Passwd']='Password'
  br.submit()
  br.retrieve('https://www.google.com/calendar/exporticalzip','exportical.zip')


Read Using cURL to interact with Google Data services.

Refer to PHP Curl with Google Calendar and Class: Google Calendar Wrapper.


There is an excellent PHP class which emulates web browsers much like curl does called Snoopy.

It allows a lot of extra functionality like extracting links from a fetched page and extracting form elements which might be quite useful in your case.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜