… | |
… | |
484 | $element = $wd->find_element ("css selector" => "body a"); |
484 | $element = $wd->find_element ("css selector" => "body a"); |
485 | $element = $wd->find_element ("link text" => "Click Here For Porn"); |
485 | $element = $wd->find_element ("link text" => "Click Here For Porn"); |
486 | $element = $wd->find_element ("partial link text" => "orn"); |
486 | $element = $wd->find_element ("partial link text" => "orn"); |
487 | $element = $wd->find_element ("tag name" => "input"); |
487 | $element = $wd->find_element ("tag name" => "input"); |
488 | $element = $wd->find_element ("xpath" => '//input[@type="text"]'); |
488 | $element = $wd->find_element ("xpath" => '//input[@type="text"]'); |
489 | # "decddca8-5986-4e1d-8c93-efe952505a5f" |
489 | => e.g. "decddca8-5986-4e1d-8c93-efe952505a5f" |
490 | |
490 | |
491 | =item $element_ids = $wd->find_elements ($location_strategy, $selector) |
491 | =item $element_ids = $wd->find_elements ($location_strategy, $selector) |
492 | |
492 | |
493 | As above, but returns an arrayref of all found element IDs. |
493 | As above, but returns an arrayref of all found element IDs. |
494 | |
494 | |
… | |
… | |
1014 | Example: call C<find_elements> to find all C<IMG> elements, stripping the |
1014 | Example: call C<find_elements> to find all C<IMG> elements, stripping the |
1015 | returned element objects to only return the element ID strings: |
1015 | returned element objects to only return the element ID strings: |
1016 | |
1016 | |
1017 | my $elems = $wd->post (elements => { using => "css selector", value => "img" }); |
1017 | my $elems = $wd->post (elements => { using => "css selector", value => "img" }); |
1018 | |
1018 | |
1019 | # yes, the W3C found an interetsing way around the typelessness of JSON |
1019 | # yes, the W3C found an interesting way around the typelessness of JSON |
1020 | $_ = $_->{"element-6066-11e4-a52e-4f735466cecf"} |
1020 | $_ = $_->{"element-6066-11e4-a52e-4f735466cecf"} |
1021 | for @$elems; |
1021 | for @$elems; |
1022 | |
1022 | |
1023 | =cut |
1023 | =cut |
1024 | |
1024 | |