FriendsOfPHP / Goutte

Goutte, a simple PHP Web Scraper
MIT License
9.26k stars 1.01k forks source link

Select input by name, set value, and click button? #358

Open SaintPaddy opened 5 years ago

SaintPaddy commented 5 years ago

For some time now, I've been running into some issues. Perhaps anyone here has an idea.

We've got a portal from a vendor. The URL I'd like to visit looks like: https://server/name/number As I'm not logged in, a login screen will be shown. Username and password need to be filled in, and then clicked on the button. The page will then reload and that contains some values I'd like to grab.

For some reason I can't find out how to fill in the INPUT fields (setValue does not exist), and then click the button.

Attached my form. Anyone nay ideas? Something like this doesn't work, it seems to do a POST or glue the values after the URL.

$form = $crawler->filter('.normal')->form(array(
    'username' => '***','password' => '****!',
));

$crawler = $client->submit($form);
print_r($crawler);

form.txt

ItsmeRahulKumawat commented 1 year ago

did u find any solution for this ?

SaintPaddy commented 1 year ago

Hello @ItsmeRahulKumawat Sorry, I didn't find a solution. Could not figure it out, so ditched this completely and went to take a different approach alltogther.