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 6061007
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T08:53:23+00:00 2026-05-23T08:53:23+00:00

How can I scrape a site using a User-Agent for Ipad? I have this

  • 0

How can I scrape a site using a User-Agent for Ipad?

I have this code below using curl in PHP which outputs the source but can’t find the tags still. On Ipad or Safari browser using an Ipad User-Agent, the tags displays when the site is loaded.

Thanks!

<?php
    $useragent= "Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B334b Safari/531.21.10')";

    $ch = curl_init ("http://www.cbsnews.com/video/watch/?id=7370279n&tag=mg;mostpopvideo");

    curl_setopt ($ch, CURLOPT_USERAGENT, $useragent); // set user agent
    curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true);
    // curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);
    echo $output = curl_exec ($ch);

    curl_close($ch);
?>
  • 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-23T08:53:24+00:00Added an answer on May 23, 2026 at 8:53 am

    Try using curl from the command line, with a perl script such as this:

    my $ua = "Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B334b Safari/531.21.10";
    my $curl = "curl -A '$ua'";
    my $server = "http://www.cbsnews.com";
    my $startpage = "$server/video/watch/?id=7370279n&tag=mg;mostpopvideo";
    my $path = "/path/to/download/to";
    open(f, "$curl -L $startpage |") or die "Cannot open website: $!";
    while (<f>)
    {
        if (/<a\s+[^>]*href=\"$server\/([^\"\/])*\"/)
        {
            my $file = $2;
            system("$curl -e $startpage $server/$file > $path/$file");
            next;
        }
    
        if (/<a\s+[^>]*href=\"$server\/([^\"]+)\/([^\"\/])*\"/)
        {
            my $folder = $1;
            my $file = "$folder/$2";
            system("mkdir -p $path/$folder");
            system("$curl -e $startpage $server/$file > $path/$file");
            next;
        }
    }
    close(f);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to scrape a remote website. I'm using PHP Curl, and my code
i'm using php curl's proxy feature to sign in to a site. I wanna
I'm using cURL to scrape web pages but I can only seem to scrape
I have a PHP scraper script which I use to scrape a page on
Hey can someone help with the following? I'm trying to scrape a site that
I'm using this script to scrape from an rss feed to view on another
I have been asked about creating a site where some users can upload Microsoft
I need to scrape a site with python. I obtain the source html code
I've done site scraping of secure page of any site on http by below
I found that you can't read from some sites using Python's urllib2(or urllib). An

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.