开发者

Using php curl to automate website. [duplicate]

开发者 https://www.devze.com 2023-03-23 19:07 出处:网络
This question already has answers here:开发者_StackOverflow中文版 Closed 11 years ago. Possible 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

精彩评论

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