Login and submit form with web-crawler

别说谁变了你拦得住时间么 提交于 2019-12-25 08:59:47

问题


So in web-crawler I pass and submit data like this

$client = new Client();
$crawler = $client->request('GET', 'link');
$form = $crawler->filter('.default')->form();
$crawler = $client->submit($form, array(
            'login'=>'ud',
            'password'=>'pw'

));

But if I use var_dump($crawler); I realise that I never get data from the website after login because it redirects me and var_dump takes data from the page where I submited.

I want after login to move to the new link to submit a form

$client->followRedirects(true);

redirects me to the new page but I can't find a way to submit there because I can't select the form nth-child but doesn't work

I use Goutte and php 7

来源:https://stackoverflow.com/questions/45534705/login-and-submit-form-with-web-crawler

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!