Skip to content
This repository has been archived by the owner on Apr 1, 2023. It is now read-only.

The current node list is empty. #474

Open
CAUN94 opened this issue Nov 29, 2022 · 4 comments
Open

The current node list is empty. #474

CAUN94 opened this issue Nov 29, 2022 · 4 comments

Comments

@CAUN94
Copy link

CAUN94 commented Nov 29, 2022

I have the next problema with this code, the last 5 month work with no problems.

$form = $crawler->selectButton('Ingresar')->form();
$form->setValues(['rut' => 'admin', 'password' => 'Pascual4900']);
$crawler = $client->submit($form);

This is the html from the page

<form id="login-form" method="POST" action="/sessions/authenticate">
	<div class="login-container">
		<div class="input" style="cursor:text;" onclick="jQuery('input', this).focus();">
			<h5 style="margin:0">Usuario</h5>
			<input name="rut" type="text" style="font-size:18px;border:0;-webkit-box-shadow:0 0 0;-moz-box-shadow:0 0 0;box-shadow:0 0 0 inset;padding:10px 0 0 0;" placeholder="Escriba su usuario...">
		</div>
		<div class="input" style="cursor:text;" onclick="jQuery('input', this).focus();">
			<h5 style="margin:0">Clave</h5>
			<input name="password" type="password" style="font-size:18px;border:0;-webkit-box-shadow:0 0 0;-moz-box-shadow:0 0 0;box-shadow:0px 0px 0px inset;padding:10px 0 0 0;" placeholder="Escriba su clave...">
		</div>
		<input id="ingresar" onclick="submitForm()" name="ingresar" class="btn btn-success" style="width:390px;-webkit-border-radius:0 !important;-moz-border-radius:0 !important;border-radius:0 !important;text-align:center;font-size:18px;font-weight:bold;color:#fff;padding:20px 0;cursor:pointer;background-image:none;" value="Ingresar">
	</div>
</form>

Thiis return this error

InvalidArgumentException
The current node list is empty.

@stof
Copy link
Member

stof commented Nov 29, 2022

There is no form in the markup you gave.

@CAUN94
Copy link
Author

CAUN94 commented Nov 29, 2022

There is no form in the markup you gave.

Sorry, this is the correct html

<form id="login-form" method="POST" action="/sessions/authenticate">
	<div class="login-container">
		<div class="input" style="cursor:text;" onclick="jQuery('input', this).focus();">
			<h5 style="margin:0">Usuario</h5>
			<input name="rut" type="text" style="font-size:18px;border:0;-webkit-box-shadow:0 0 0;-moz-box-shadow:0 0 0;box-shadow:0 0 0 inset;padding:10px 0 0 0;" placeholder="Escriba su usuario...">
		</div>
		<div class="input" style="cursor:text;" onclick="jQuery('input', this).focus();">
			<h5 style="margin:0">Clave</h5>
			<input name="password" type="password" style="font-size:18px;border:0;-webkit-box-shadow:0 0 0;-moz-box-shadow:0 0 0;box-shadow:0px 0px 0px inset;padding:10px 0 0 0;" placeholder="Escriba su clave...">
		</div>
		<input id="ingresar" onclick="submitForm()" name="ingresar" class="btn btn-success" style="width:390px;-webkit-border-radius:0 !important;-moz-border-radius:0 !important;border-radius:0 !important;text-align:center;font-size:18px;font-weight:bold;color:#fff;padding:20px 0;cursor:pointer;background-image:none;" value="Ingresar">
	</div>
</form>

@stof
Copy link
Member

stof commented Nov 29, 2022

And your <input id="ingresar"> does not have type=button so it is not a button either.

@CAUN94
Copy link
Author

CAUN94 commented Nov 29, 2022

that could be the problem, i was thinking that the website change the html, which other command could i use to do the same?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants