perform clicks and logout of website using cURL and php -


i used curl login website. natural question how perform clicks on buttons , logout. example..javascript uses click() function. php use? clues.

i following book on web scraping. in author logins it's publishers website. book old , out of date. more over, says nothing logging out. publisher: https://www.packtpub.com/

you can't click button using php alone. php doesn't work that. php can download html of webpage, can't perform actions browser can.

if want that, need headless browser. headless browser typically seen invisible browser. can things regular browser can do. there's phantomjs, , casperjs, this.

there php libraries use phantomjs. example php phantomjs. personally, i've never done php, use phantomjs , casperjs on regular basis.

alternative that, can php parse dom links, or buttons, , replicate http request that's made when clicking links/buttons.

for example, if there's link goes /contactus, create request page using curl. response source code and/or headers.

i working on project uses casperjs, php , redis create rather complex scraper/automation/analysis tool large social network.

as side note, sites rely heavily on javascript , using curl may not enough. can around parsing javascript file/s, , other advanced magic, believe me not want go down route. why use casperjs on occasions. it's slower, that's we've got @ moment.

as logging out ... delete cookies file. done.


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -