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

  • SEARCH
  • Home
  • 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 7065523
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T04:58:00+00:00 2026-05-28T04:58:00+00:00

When we enter a word in Google image search, a page is returned. This

  • 0

When we enter a word in Google image search, a page is returned. This page contains many pictures with thumbnail view. I want to save the location URL of these images in my database (MySQL). I need to code this in PHP and I want to save URL of first 10 images.
I am designing a dynamic page, I will pick these image URL addresses from database and will show these on my dynamic page.

I have already tried a lot and problem is my complete URL is not saved because it contains many invalid characters for MySQL. I have searched many sites and found different functions but I am still not clear about this: I am at failure in devising an idea how I can do this job.
Can somebody give me some PHP code or a procedure how it could be done?

  • 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-05-28T04:58:01+00:00Added an answer on May 28, 2026 at 4:58 am

    I would suggest you should use PHP’s DOM Library. It is very powerful and allows parsing any DOM structure. Refer some of its examples and you could implement it easily.

    The idea is that you study the HTML structure of the page returned by Google and accordingly use the DOM library for parsing specific tags. From what I see, the images are organized as <ul> and <li> tags, like:

    <ul class="rg_ul" data-pg="1" data-cnt="6">
        <li class="rg_li" data-row="1" style="width:216px;height:162px"></li>
        <li class="rg_li" style="width:231px;height:162px"></li>
        <li class="rg_li" style="width:218px;height:162px"></li>
        <li class="rg_li" style="width:216px;height:162px"></li>
        <li class="rg_li" style="width:216px;height:162px"></li>
        <li class="rg_li" style="width:217px;height:162px"></li>
    </ul>
    

    Within each <li> tag there are additional tags, one of which is <a>. This tag seems to be having 2 attributes – “imgrefurl” and “imgurl” – that might give you the image you need. Which of these 2 attributes you need is for you to explore.

    Alternatively, there is an <img> tag within <li> that has a “src” attribute containing the actual image binary. So you may parse it as well. Please note that the binary is for the image that you see on the search page and not the actual image.

    For some pointers to DOM, this method might be useful – http://www.php.net/manual/en/domelement.getelementsbytagname.php and http://www.php.net/manual/en/domelement.hasattribute.php – to read all <li> tags and then parse for the ones using class “rg_li”.

    I hope the above makes sense

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Pressing enter inside a textbox refreshes the whole page in Google Chrome. please help
I'm trying to enter a word and have it show up on page through
letter = prompt(Enter a word please); letter = letter.toUpperCase(); // define letters and respective
In my app i have a text field where if i enter a word
I am trying to get a program to let a user enter a word
I would like to have the following search in Vim too (reverse-i-search)`': Enter a
Im using this code to restrict the user to not enter special characters $(input).keyup(function(){
When I user click on the button remove word and as enter 2 in
I want to read a word from standard input and then find out its
Basically this program searches a .txt file for a word and if it finds

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.