Home  >  Q&A  >  body text

laravel - Crawling using Guzzle software, how to log in?

The author uses Guzzle in the laravel framework to crawl the data on my homepage, purely out of interest; but the page obtained is the login page;

The author tried this way of writing, but it didn’t work

$response = $this->client->request('GET', '/u/greenlightt/articles', array(
    'auth' => [用户名,密码]
));

I hope someone can tell me?

学习ing学习ing2658 days ago761

reply all(1)I'll reply

  • ringa_lee

    ringa_lee2017-06-13 09:26:34

    First, you need to simulate login, then save cookies, and then use the cookies you got to crawl other pages. Let’s talk about your problem. . Boss Sunny will laugh like a barbell = =

    reply
    0
  • Cancelreply