Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Redirecting to a third party site with injected HTML

Thread Tools

Redirecting to a third party site with injected HTML

Denis McMahon
Posts: n/a
On Sun, 09 Jun 2013 10:09:17 -0700, guytamir1 wrote:

> i'm not really sure how to approach this problem..
> hints

Let me restate the problem for you:

You want to display a web page to a visitor that exists on a third party
website, with some of your own html inserted into it.

Setting aside the multitude of ethical, moral, legal and copyright
issues, the only technical solution I can see that doesn't involve
hacking the third party website is to scrape the third party website
using eg curl, modify the html using your scripting environment of choice
(I'll assume python) either using some form of dom manipulation or string
manipulation, and then server the modified page to the visitor.

so pycurl and pydom might be good places to start.

Don't forget that you may need to rewrite urls in the scraped document
for things such as anchors, images, css, javascript etc to point them
back at the host server, or some script on your server that can obtain
and serve the appropriate resources.

Alternatively, how about displaying the third party website in an iframe
within your own document? Although that's not really pythonic, just

Denis McMahon, Removed)
Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with printing a bit pattern with printf and %x C Programming 9 04-19-2013 12:14 PM
Connecting Third Party Wireless Device to Livebox using Windows XP =?Utf-8?B?VHJhY3k=?= Wireless Networking 2 12-05-2005 07:22 PM
Re: Use Third Party HTML Designer Cowboy \(Gregory A. Beamer\) ASP .Net 2 11-05-2003 10:15 PM
HTML "a name" question from third party site - Query Miles Davenport HTML 5 10-23-2003 09:14 PM
Improved third-party (preferably free) scroll bar Kieran Benton ASP .Net 3 09-11-2003 02:38 AM