Trouble with Xpath and YQL

thenis

New Member
Hopefully this is easy enough. I am trying to use YQL to pull "header" images off different articles of a word press blog. Each article has a different "header" image with slightly different class names (no id). Every Image I need shares one base css class, "alignright." If I do a query like the one below, I get nothing returned.\[code\]select * from html where url="urlofblog.com/" and xpath="//img[@class='alignright']"\[/code\]However, if I change the query so that it matches the classes to a particular image exactly\[code\]select * from html where url="urlofblog.com/" and xpath="//img[@class='alignright size-full wp-image-3051']"\[/code\]I get the image in question back. It looks like YQL sees "img[@class=" as one big string, rather than multiple inputs. The problem is none of these images classes match up when viewed as one big string. Here is what I've tried to fix the situation:[*]I have looked into a 'like' parameter for YQL. (no luck finding something that worked)[*]tried to find a better way with xpath (which until today I have never used). That search led me here. So far I still cant get it to work.[*]I've tried using: img[matches(@class, '\balignright\b')], but I dont' think YQL supports it.Does anyone know if there is a way to grab images with that base css class? I do not have access to change anything on the blog (like inserting ids).
 
Back
Top