Wednesday, 15 April 2015

html - PHP Goutte. Select button without "value" field -


This is my target website: and I want to do a search there, let's say string "symphony" to know its Weaknesses

While inspecting the elements of the input form, I think its name is "q", so far the best, but the button has no value, instead of the button I need to submit my query Is: Code> & lt; Span id = "run_search" class = "vbsearchBtn" & gt; & Lt; / Span & gt; without the value field.

My code:

  $ Client = new customer (); $ Crawler = $ client- & gt; Request ('GET', 'http://www.rapid7.com/db/'); $ Form = $ Crawler- & gt; Selection Button ('????') - & gt; Form (); $ Crawler = $ client- & gt; Submit ($ form, array ('q' = & gt; 'symphony')); Print $ Crawler- & gt; Html (); Do anyone have to know how to take it out?   

As I understand your problem is to get the form element, Why is it necessary? You can query the form by ID which & lt; Form id = "search_form" ... & gt; . You may want to submit the t parameter, which is the database type that you want to query ( a all m for module v for vulnerabilities). Your code should be something like this (you need a CssSelector component):

  $ client = new client (); $ Crawler = $ client- & gt; Request ('GET', 'http://www.rapid7.com/db/'); $ Form = $ crawler- & gt; Filters ('# search_form') - & gt; First () - & gt; Form (); $ Crawler = $ client- & gt; Submit ($ form, array ('q' => gt; symphony '' 't' = & gt; 'a')); Print $ Crawler- & gt; Html ();  

No comments:

Post a Comment