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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T13:37:33+00:00 2026-05-15T13:37:33+00:00

I was trying to use the program cURL inside of BASH to download a

  • 0

I was trying to use the program cURL inside of BASH to download a webpage’s source code. I am having difficulty when trying to download a page’s code when the page is using more complex encoding than simple HTML. For example I am trying to view the following page’s source code with the following command:

curl "http://shop.sprint.com/NASApp/onlinestore/en/Action/DisplayPhones?INTNAV=ATG:HE:Phones"

However the result of this doesn’t match the source code generated by Firefox when I click “View source”. I believe it is because there are Javascript elements on the page, but I can not be sure.

For example, I can not do:

curl "http://shop.sprint.com/NASApp/onlinestore/en/Action/DisplayPhones?INTNAV=ATG:HE:Phones" | grep "Access to 4G speeds"

Even though that phrase is clearly found in the Firefox source. I tried looking through the man pages but I don’t know enough about the problem to figure out a possible solution.

A preferable answer will include why this is not working the way I expect it to and a solution to the issue using curl or another tool executable from a Linux box.

EDIT:

Upon suggestion below I have also included a useragent switch with no success:

curl "http://shop.sprint.com/NASApp/onlinestore/en/Action/DisplayPhones?INTNAV=ATG:HE:Phones" -A "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.3) Gecko/20100423 Ubuntu/10.04 (lucid) Firefox/3.6.3" | grep -i "Sorry"
  • 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-15T13:37:33+00:00Added an answer on May 15, 2026 at 1:37 pm

    I don’t see the “Access to 4G speed” thing in the first place when I go to that page.

    The two most likely culprits for this difference are cookies and your user-agent.

    You can specify cookies manually using both curl or wget. Dump out your cookies from Firefox using whatever plugins you want, or just

    javascript:prompt('',document.cookie);
    

    in your location bar
    Then stick read through the man pages for wget or curl and see how to include that cookie.


    EDIT:
    It appears to be what I thought, a missing cookie.

    curl --cookie "INSERT THE COOKIE YOU GOT HERE" http://shop.sprint.com/NASApp/onlinestore/en/Action/DisplayPhones?INTNAV=ATG:HE:Phones | grep "Access to 4G"
    

    As stated above, you can grab whatever you cookie is from above: javascript:prompt('',document.cookie) then copy the default text that comes up. Make sure you’re on the sprint page when you stick that in the location bar (otherwise you’ll end up with the wrong website’s cookie)


    EDIT 2

    The reason your browser cookie and your shell cookie were different was the different in interaction that took place.

    The reason I didn’t see the Access to 4G speed thing you were talking about in the first place was that I hadn’t entered my zip code.

    If you want to have a constantly relevant cookie, you can force curl to do whatever is required to obtain that cookie, in this case, entering a zip code.

    In curl, you can do this with multiple requests and holding the retrieved cookies in a cookie jar:

     [stackoverflow]  curl --help | grep cookie
     -b/--cookie <name=string/file> Cookie string or file to read cookies from (H)
     -c/--cookie-jar <file> Write cookies to this file after operation (H)
     -j/--junk-session-cookies Ignore session cookies read from file (H)
    

    So simply specify a cookie jar, send the request to send the zipcode, then work away.

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

Sidebar

Related Questions

I'm trying to use rusage statistics in my program to get data similar to
I am trying to use MinGW to compile a C program under Windows XP.
I'm trying to use mtrace to detect memory leaks in a fortran program. I'm
Trying to use an excpetion class which could provide location reference for XML parsing,
Trying to use a guid as a resource id in a rest url but
While trying to use LINQ to SQL I encountered several problems. I have table
I' trying to use a Linq query to find and set the selected value
I trying to use ImageInfo and Jython to get information from a image on
I'm trying to use svnmerge.py to merge some files. Under the hood it uses
I've been trying to use SQLite with the PDO wrapper in PHP with mixed

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.