Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need the ability to parse saved data by regex #25

Open
danvideo opened this issue Sep 22, 2016 · 1 comment
Open

Need the ability to parse saved data by regex #25

danvideo opened this issue Sep 22, 2016 · 1 comment

Comments

@danvideo
Copy link
Collaborator

When WebMinion runs and performs the :save_value method, it will likely return extraneous text as well desired text.

For example, say you want a particular table element and "target" : "//td[1]" there will probably be extra text there, such as this:
#<Nokogiri::XML::Element:0x3fe5fcc42a58 name="td" children=[#<Nokogiri::XML::Text:0x3fe5fcc47468 "SPECIFIC TEXT AND ID HERE: ">, #<Nokogiri::XML::Element:0x3fe5fcc46e00 name="i" children=[#<Nokogiri::XML::Text:0x3fe5fcc46810

So a generic bot method - irrespective of bot driver - to run a regex on saved_data values to clean up data would be great.

@stevendaniels
Copy link
Collaborator

One possible way to go about this is to add a few more attributes for save_value, e.g.

{
  "name": "Save Price",
  "target": "#item_price",
  "value": "prie",
   "type": "integer",
   "is_validator": false
}

Where type can be one of the following: text, integer, number, regex.

Thoughts?

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

No branches or pull requests

3 participants