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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T11:58:05+00:00 2026-05-27T11:58:05+00:00

I am trying to get HTML code from a webpage that is not in

  • 0

I am trying to get HTML code from a webpage that is not in the same domain. The html text is parsed & summarises a recipe(recipe name, main ingredients, no. of steps) found on that page the HTML code was from.

The user can then click the link & go to that webpage outside the domain to view the recipe.

I’m aware of the Same-Origin-Policy, but does that apply to getting HTML code from a webpage outside the domestic domain? I imagine its exactly the same as getting XML, so this is legal & allowed isn’t it?

Is there a way I can get the HTML text/code from a domain outside my domestic domain?

Using Javascript & JQuery, the idea is to limit the amount of server requests & storage by having the user perform requests for each recipe & parsing the HTML on the client side. This stops server side bottlenecks & also means I dont have to go through the server & delete old outdated recipe summarisations.

I’m open to Solutions/Suggestions in any programming language or API or etc.

  • 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-27T11:58:06+00:00Added an answer on May 27, 2026 at 11:58 am

    What you are trying to do can’t be done using any AJAX library. Browsers’ cross-domain policy won’t allow you to do this.

    But you can do this with a combination of php (or any other server-side language) and AJAX. Create a php script like this:

    <?php
        $url=$_POST['url'];
        if($url!="")
            echo file_get_contents($url);
    ?>
    

    Let us say the script’s name is fetch.php.
    Now you can throw an AJAX call from your jQuery code to this fetch.php and it will fetch the HTML code for you.

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

Sidebar

Related Questions

I am trying to get the javascript code from an html file using C#
Im trying to grab a HTML source code from a webpage which needs user
I am trying to get a working regular expression to convert standard HTML code
I'm trying to get a HTML source of a website through C# code. When
I'm trying to get the elements in an HTML doc that contain the following
I'm trying to get an object element from my webpage using getElementById (ultimately so
I am trying to get value from an HTML list <div id=test> <ul> <li>C:\
I'm trying to get an html page to display an XML file formatted with
I'm trying to get the HTML of a selected object with jQuery. I am
I am trying to get the html value of a linked clicked. The links

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.