473,386 Members | 1,754 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,386 software developers and data experts.

Getting the source of a remote webpage

Is it possible to get the source of a remote webpage (just the
straight HTML) without anything too complicated (like COM, I just want
to write a simple script if possible) and write it to a file? For
example, is it possible to do something like os.system(....run
iexplorer.exe command....) with another command that automatically
opens the page? Thanks.

Ryan Kaskel
Jul 18 '05 #1
3 1659
On Wed, 23 Jun 2004 19:47:02 -0700, Ryan Kaskel wrote:
Is it possible to get the source of a remote webpage (just the
straight HTML) without anything too complicated (like COM, I just want
to write a simple script if possible) and write it to a file? For
example, is it possible to do something like os.system(....run
iexplorer.exe command....) with another command that automatically
opens the page? Thanks.


import urllib

f = urllib.urlopen(url)
s = site.read()


----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
Jul 18 '05 #2
In article <pa****************************@newsfeeds.com>, Nugget wrote:
Is it possible to get the source of a remote webpage (just the
straight HTML) without anything too complicated (like COM, I
just want to write a simple script if possible) and write it
to a file? For example, is it possible to do something like
os.system(....run iexplorer.exe command....) with another
command that automatically opens the page? Thanks.


import urllib

f = urllib.urlopen(url)
s = site.read()


least we lead the gentle reader astray...
import urllib
f = urllib.urlopen('http://www.visi.com')
s = site.read()
Traceback (most recent call last):
File "<stdin>", line 1, in ?
NameError: name 'site' is not defined

What you meant was:
s = f.read()
print s

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html>
[...]

--
Grant Edwards grante Yow! ... A housewife
at is wearing a polypyrene
visi.com jumpsuit!!
Jul 18 '05 #3
Nevermind....a simple look in the Standard Library gave me the simple
solution I needed....
ry**@ryankaskel.com (Ryan Kaskel) wrote in message news:<69**************************@posting.google. com>...
Is it possible to get the source of a remote webpage (just the
straight HTML) without anything too complicated (like COM, I just want
to write a simple script if possible) and write it to a file? For
example, is it possible to do something like os.system(....run
iexplorer.exe command....) with another command that automatically
opens the page? Thanks.

Ryan Kaskel

Jul 18 '05 #4

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

Similar topics

4
by: Ryan Kaskel | last post by:
How can I obtain the source of a remote webpage (e.g. http://www.python.org/index.html) using Python? Something like: pyPage = open('http://www.python.org/index.html',r).read() Obviously...
2
by: Deepson Thomas | last post by:
HI, i have a question abt dot net. Let me tell you the sceneraio...i have a asp.net page written in C#. there is a textbox and a button in the page thatz it. the functionality i want is that...
14
by: jj | last post by:
Is it possible to call a remote php script from within Access? I'm thinking something like: DoCMD... http://www.domain.com/scripts/dataquery.php DoCmd.OpenQuery "update_data", acNormal, acEdit...
4
by: russzee | last post by:
Hi, I want to populate my client's webpage (Remote Server) automatically through my Server and Database by having him just paste a javascript on his webpage. I have read up about Microsoft...
0
by: hafeez | last post by:
Hi , My requirement is to read and write the data from remote SQL SERVER. Locally i have SQL SERVER and i want read and write the data from remote SQL SERVER. I am able to read the data from...
9
by: =?Utf-8?B?UmF5?= | last post by:
Have SQL server on one machine. Have IIS on another machine in same large intranet. Have website in IIS with Basic Authentication turned on and other options deselected. Have webpage (.aspx) with...
1
by: Bell Deep | last post by:
I wanted to create a webpage(using HTML), where I want to display the contents of a remote folder (the folder is in the server). I need to display the contents (i.e, files or subfolders) of that...
3
by: =?GB2312?B?zPC5zw==?= | last post by:
Howdy, all, I want to use python to detect the accessibility of website. Currently, I use urllib to obtain the remote webpage, and see whether it fails. But the problem is that the webpage may be...
0
by: aboutjav.com | last post by:
Hi, I need some help. I am getting this error after I complete the asp.net register control and click on the continue button. It crashed when it tries to get it calls this Profile property ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.