How do I get the value of an input field like the one below where it does not have an ID attribute using PHP’s DOMDocument?
<input type="text" name="make" value="Toyota">
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
XPath makes it simple, assuming that’s the only text input with “make” as its name:
If there’s more than one input with that particular field name on the page (which is entirely possible), then you’ll have to do some extra work to narrow down WHICH of those multiple inputs you want.