Jump to content
UBot Underground

How To Scrape The Options From A Select


Recommended Posts

Hello!

Could anyone help me to scrape an html <select>?

 

In a page I have some html <select>, I need to scrape the innertext of each option for a particular select, I know how to select the correct one but I cant find the way to scrape each option...

 

Any help would be appreciated.

 

Thank you!

Link to post
Share on other sites

try

load html("<select>
  <option value=\"volvo\">Volvo</option>
  <option value=\"saab\">Saab</option>
  <option value=\"opel\">Opel</option>
  <option value=\"audi\">Audi</option>
</select>")
set(#Html,$scrape attribute($element offset(<tagname="select">,0),"innerhtml"),"Global")
alert($find regular expression(#Html,"(?<=\">).*?(?=<)"))
Link to post
Share on other sites

If you want to try learning CSS Selectors(Jquery Selectors) Ive a plugin with a few useful functions one of them is child selectors,the plugin is free in the plugin section,Ive made a quick intro video into them too on the thread

 

Code is pretty simple,get all the children elements Value of the tagname select

 

alert($plugin function("DeliterCSS.dll", "Deliter CSS Child Elements Selector", $document text, "select", "Value"))

Link to post
Share on other sites

Great! it works with pash code.

Deliter, I would like to give a try to your plugin but I couldn't find it, where should I download it?

 

Thank you for your help!!

Link to post
Share on other sites

Great! it works with pash code.

Deliter, I would like to give a try to your plugin but I couldn't find it, where should I download it?

 

Thank you for your help!!

 

Check this link for deliter plugin

http://network.ubotstudio.com/forum/index.php/topic/19608-css-selector-plugin-free/

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...