473,394 Members | 1,722 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

load web page to variable

I have an url of a webpage.
I would like to load the content of the webpage to a variable.

Sth like this:

variable = loadwebpage( url )

How to do it?

(I have just spent more than an hour googling for a recipe - without
satisfaction)

-tt.
Aug 13 '07 #1
11 8161
Tomek Toczyski wrote:
I have an url of a webpage.
I would like to load the content of the webpage to a variable.

Sth like this:

variable = loadwebpage( url )

How to do it?
Provided that protocol, domain and port part of the request URIs are the
same, you can use the (I)XMLHttpRequest object. Otherwise you have to use
a server-side solution, at least partially. You can work around the Same
Origin Policy with URL rewrite, or you can retrieve the resource with
server-side scripting.

Note that copyright/author's rights may be involved.

This was a FAQ.
HTH

PointedEars
--
"Use any version of Microsoft Frontpage to create your site. (This won't
prevent people from viewing your source, but no one will want to steal it.)"
-- from <http://www.vortex-webdesign.com/help/hidesource.htm>
Aug 13 '07 #2
Thomas 'PointedEars' Lahn:
Tomek Toczyski wrote:
>I have an url of a webpage.
I would like to load the content of the webpage to a variable.

Sth like this:

variable = loadwebpage( url )

How to do it?

Provided that protocol, domain and port part of the request URIs are the
same, you can use the (I)XMLHttpRequest object.
Yes, everything is the same.

Thank you for your hint. But I need a working recipe.
I am not an AJAX programmer and I have only basic knowledge of Javascript
and I have no time to learn it at the moment.

I need a recipe for loading a webpage to a variable...
One simple thing. I will be glad for your help.

-tt
Aug 13 '07 #3
Tomek Toczyski wrote:
Thomas 'PointedEars' Lahn:
>Tomek Toczyski wrote:
>>I have an url of a webpage.
I would like to load the content of the webpage to a variable.

Sth like this:

variable = loadwebpage( url )

How to do it?
Provided that protocol, domain and port part of the request URIs are the
same, you can use the (I)XMLHttpRequest object.

Yes, everything is the same.

Thank you for your hint. But I need a working recipe.
I am not an AJAX programmer and I have only basic knowledge of Javascript
and I have no time to learn it at the moment.
I need a recipe for loading a webpage to a variable...
You are looking for a paid support forum, not this discussion group.
One simple thing. I will be glad for your help.
How much exactly?
PointedEars
--
Prototype.js was written by people who don't know javascript for people
who don't know javascript. People who don't know javascript are not
the best source of advice on designing systems that use javascript.
-- Richard Cornford, cljs, <f8*******************@news.demon.co.uk>
Aug 13 '07 #4
You are looking for a paid support forum, not this discussion group.

I thought that my problem is quite common and there is a working recipe
for it. I might be wrong.
>
>One simple thing. I will be glad for your help.

How much exactly?
zero $.

I need it for a webpage that I develop as a volunteer.
Sorry.

-tt.
Aug 13 '07 #5
Tomek Toczyski said the following on 8/13/2007 5:25 AM:
>You are looking for a paid support forum, not this discussion group.

I thought that my problem is quite common and there is a working recipe
for it.
It is a common question here. So common it is answered in the group FAQ:

<URL: http://jibbering.com/faq/index.html#FAQ4_44>
I might be wrong.
You aren't wrong in that regards.
>>
>>One simple thing. I will be glad for your help.

How much exactly?

zero $.

I need it for a webpage that I develop as a volunteer.
Sorry.
Ignore Thomas, he might exit puberty in a few years.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Aug 13 '07 #6
Randy Webb meinte:
Tomek Toczyski said the following on 8/13/2007 5:25 AM:
>>You are looking for a paid support forum, not this discussion group.

I thought that my problem is quite common and there is a working
recipe for it.

It is a common question here. So common it is answered in the group FAQ:

<URL: http://jibbering.com/faq/index.html#FAQ4_44>
Given the information by the OP: Do you think those links are helpful
*for him*?
>zero $.

I need it for a webpage that I develop as a volunteer.
That does not necessarily justify, that others have to work for you for
free as well.
Ignore Thomas, he might exit puberty in a few years.
Well, you sound pretty grown up...

Gregor
--
http://www.gregorkofler.at ::: Landschafts- und Reisefotografie
http://www.licht-blick.at ::: Forum für Multivisionsvorträge
http://www.image2d.com ::: Bildagentur für den alpinen Raum
Aug 13 '07 #7
Gregor Kofler said the following on 8/13/2007 5:42 AM:
Randy Webb meinte:
>Tomek Toczyski said the following on 8/13/2007 5:25 AM:
>>>You are looking for a paid support forum, not this discussion group.

I thought that my problem is quite common and there is a working
recipe for it.

It is a common question here. So common it is answered in the group FAQ:

<URL: http://jibbering.com/faq/index.html#FAQ4_44>

Given the information by the OP: Do you think those links are helpful
*for him*?
Actually, yes. Since the OP stated "I would like to load the content of
the webpage to a variable", the only reasonable approach to that would
be an AJAX request or to load it in an IFrame and read the innerHTML or
such of the IFrame.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Aug 13 '07 #8
Randy Webb:
It is a common question here. So common it is answered in the group FAQ:

<URL: http://jibbering.com/faq/index.html#FAQ4_44>
exactly: http://jibbering.com/faq/index.html#FAQ4_38

Tkank you very much!
It is what I have been looking for.
(I didn't checked it in FAQ before because jibbering.com was unavailable
for me few hours ago)
-tt.
Aug 13 '07 #9
Randy Webb meinte:
>Given the information by the OP: Do you think those links are helpful
*for him*?

Actually, yes. Since the OP stated "I would like to load the content of
the webpage to a variable", the only reasonable approach to that would
be an AJAX request or to load it in an IFrame and read the innerHTML or
such of the IFrame.
I know. But to me it sounded more like "I want a ready-to-roll solution"
(i.e. copy 'n' paste); anyway, I was obviously wrong on that.

Gregor
--
http://www.gregorkofler.at ::: Landschafts- und Reisefotografie
http://www.licht-blick.at ::: Forum für Multivisionsvorträge
http://www.image2d.com ::: Bildagentur für den alpinen Raum
Aug 13 '07 #10
Tomek Toczyski wrote:
Randy Webb:
>It is a common question here. So common it is answered in the group FAQ:

<URL: http://jibbering.com/faq/index.html#FAQ4_44>

exactly: http://jibbering.com/faq/index.html#FAQ4_38

Tkank you very much!
It is what I have been looking for.

(I didn't checked it in FAQ before because jibbering.com was unavailable
for me few hours ago)
Sigh. [psf 10.1]

,-<46**************@PointedEars.de>
| Provided that protocol, domain and port part of the request URIs are the
| same, you can use the (I)XMLHttpRequest object.
^^^^^^^^^^^^^^^^^
http://www.google.com/search?q=ixmlh...quest&filter=0

When will Google finally become a school subject? [psf 6.2]
PointedEars
--
realism: HTML 4.01 Strict
evangelism: XHTML 1.0 Strict
madness: XHTML 1.1 as application/xhtml+xml
-- Bjoern Hoehrmann
Aug 13 '07 #11
Thomas 'PointedEars' Lahn said the following on 8/13/2007 7:21 AM:
Tomek Toczyski wrote:
>Randy Webb:
>>It is a common question here. So common it is answered in the group FAQ:

<URL: http://jibbering.com/faq/index.html#FAQ4_44>
exactly: http://jibbering.com/faq/index.html#FAQ4_38

Tkank you very much!
It is what I have been looking for.

(I didn't checked it in FAQ before because jibbering.com was unavailable
for me few hours ago)

Sigh. [psf 10.1]
Will you ever learn to write comprehensible english?
,-<46**************@PointedEars.de>
| Provided that protocol, domain and port part of the request URIs are the
| same, you can use the (I)XMLHttpRequest object.
^^^^^^^^^^^^^^^^^
http://www.google.com/search?q=ixmlh...quest&filter=0
Which doesn't even come close to being as accurate nor helpful as the
URL given for the FAQ.
When will Google finally become a school subject? [psf 6.2]
Probably right after you exit puberty and realize that not everybody who
posts here is doing homework.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Aug 13 '07 #12

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: user | last post by:
when i first load index.php with arguments ie: "index.php?page=x", the $_SERVERvalue is null. I then get the session id appended to each link. If i refresh the page, I get the $_SERVER I want, but...
3
by: William LaMartin | last post by:
If I create a RadioButtonList with, say, two items, then after the page loads and I select one of the items and then click on a button whose click event contains some code to display the...
0
by: Frank 'Olorin' Rizzi | last post by:
Hello everyone. This is quite convoluted, but I'll try to make it simple. I have a couple of bottom-line questions (I guess): 1~ what happens between the Page_Load routine in the code behind...
7
by: Goober | last post by:
I have a page that receives a session variable from the default.aspx. On Page load, the code in Page load gets executed twice. So far, no problem. It sets the session variable each time,...
7
by: Dan Nash | last post by:
Hi guys Ok, i have an aspx with a user control. In the user controls pageload i set a property (mystring = "test";). i then want to access that from the page_load of the aspx thats using the...
1
by: Reza Nabi | last post by:
Bakground: I have a webform (LoadCtl.aspx) which loads the user control to a placeholder dynamically based on the ctlName querystring passed in the URL. Webform (LoadCtl.aspx) also passes a...
15
by: H00ner | last post by:
Hello All Hope you can help Been pulling my hair out about a popup problem in ASP.NET. One of the forms i wrote requires the user to select a product from a list in a popup web form. the...
1
by: Vidyadhar Joshi | last post by:
I have the following scenario in a true load balanced environment (without sticky sessions): There are 2 ASPX pages. I want to pass an object from the first page to the second page. On the...
3
by: GauravGupta | last post by:
i want to know that is it posible to call button click event before page load event on post back.... please help me....
2
by: GauravGupta | last post by:
i am displaying a table in page load whose data is fetched from database . it also check what data is to be displayed from data base by a session variable. and i have few button which change the...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.