Issue
For example, if I want to find link tag with application type "application/javascript" or "application/ecmascript", I would like to do something like this:
response.xpath("head/link[contains(@type, "javascript", "ecmascript")]")
It goes without saying that the code I putted above will raise an exception.
But I haven't found the way which will help me to apply multiple conditions in one XPath query.
Solution
Try this:
response.xpath("head/link[@type[contains(., 'javascript') or contains(., 'ecmascript')]]")
Be careful not using the same quotes in code and XPath.
Answered By - Siebe Jongebloed
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.