Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8254399
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T01:10:29+00:00 2026-06-08T01:10:29+00:00

Hopefully this is easy enough. I am trying to use YQL to pull header

  • 0

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.

select * from html where url="urlofblog.com/" and xpath="//img[@class='alignright']"

However, if I change the query so that it matches the classes to a particular image exactly

select * from html where url="urlofblog.com/" and xpath="//img[@class='alignright size-full wp-image-3051']"

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:

  1. I have looked into a ‘like’ parameter for YQL. (no luck finding something that worked)
  2. 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.
  3. 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).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T01:10:31+00:00Added an answer on June 8, 2026 at 1:10 am

    Using the XPath contains() string function would be a good here. It looks like that you are trying to get the image from a WordPress site that will add classes to items as needed. Do not worry about if it start with the CSS class just that the img has the CSS class in the class attribute.

    //img[contains(@class,'alignright')]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hopefully this is an easy question to answer! I am trying to use GtkEntryCompletion
Hopefully this is an easy question. I'm trying to learn backbone and i'm stuck
hopefully this is a really easy question. I'm trying to achieve the following style
hopefully this will be an easy answer for some of you CSS veterans out
This is hopefully very easy to do, but I can't find any doco on
This is hopefully an easy question to answer for someone familiar with Mozilla, but
Hopefully this is an easy one. Is there a way to test for an
Hopefully this is an easy question. How can I define an XML type such
Hopefully this has an easy answer I just haven't been able to find: I
I am new to SQL so hopefully this has an easy answer. I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.