-2

Can you output a list of option values in a select tag with XPath? I am only able to grab the labels. Can you actually output an attribute of a tag with XPath? I am using importxml in Google Sheets but if there is another way to accomplish this that is my problem.

example <select name="store".... <option value = 101>store #1</option> .... etc etc

I want to return a list of all the values not the actual label between the tags... can this be done with XPath? If not what is another way to do it with the import functions in google sheets?

CodeCamper
  • 5,032
  • 4
  • 31
  • 77
  • Possible duplicate of [Extract value of attribute node via XPath](https://stackoverflow.com/questions/4835891/extract-value-of-attribute-node-via-xpath) – JaSON May 14 '19 at 18:54
  • @JaSON although the answer is almost the same I think this was a more specific version of the question. – CodeCamper May 16 '19 at 02:11

1 Answers1

0

to receive the value of an attribute do @nameofattribute like so...

=importxml("yourwebsite.com","//select//@value")

CodeCamper
  • 5,032
  • 4
  • 31
  • 77