Create Automated Websites with Python

Make a Website Video TutorialI while back I showed you how to Make Money Blogging by setting up a simple automated WordPress blog using WP-O-Matic. I was then asked for an automated site that allowed for more robust article grabbing.

In the video below I show you how to grab content from any website and then send that to the Postie WordPress Plugin, that will post it to your site automatically. Here is an article on How to Use Postie.

All of the code I used in the Automated Website Video follows the video. Use it as you wish.

To understand any of this stuff, you might like to check out my Python How to Tutorial Video and Regex Tutorial Video.

If you have any questions or comments, leave them in the comment section below.


All the Code From the Video

import httplib2, re

def grabSiteTags(pageToSearch):
grabHtmlTags = re.compile(‘<title>(.{5,90})</title>|<summary>(.{5,300})</summary>|<link rel=”alternate” type=”text/html” href=”(.{5,100})”/>’, re.IGNORECASE)

allTheTags = re.findall(grabHtmlTags,pageToSearch)

for i in allTheTags:
print(i[0].replace(“\\'”,”‘”) +  i[1].replace(“\\'”,”‘”) + i[2].replace(“\\'”,”‘”) + “\n”)


def getTheArticle(pageToSearch):
if pageToSearch:

i = httplib2.Http(‘.cache’)
content = i.request(pageToSearch)

content = str(content)

grabHtmlTags = re.compile(‘<div>.{1,40}<p>(.{1,800})’, re.IGNORECASE)

allTheArticle = re.findall(grabHtmlTags,content)

allTheArticle = str(allTheArticle)

if (len(allTheArticle) > 100):
print(“Article: ” + allTheArticle.replace(“\\\\'”,”‘”).replace(“\\n'”,””).replace(“\\'”,”‘”).replace(“\\\\n”,””).replace(“\\\\t”,””))

def main():
urlToGet = “”

h = httplib2.Http(‘.cache’)
content = h.request(urlToGet)


if __name__ == “__main__”: main()

8 Responses to “Create Automated Websites with Python”

  1. mike Joes says:

    Thanks alot for this tutorial. By the way you forgot to mention my name in that :D.

  2. Mike Joes says:

    I also have one more question, what is the easiest way to create a Squeeze page/Sales page. Most of the such WordPress themes are expensive/professional designers charge a lot. Can you suggest a way to do this quickly. Your feedback will be highly appreciated

    • admin says:

      I use a program called Artisteer to create WordPress templates quickly. Since your so nice, tell me what you want your site to look like and I’ll make you a WordPress theme. Give me examples of sites you like 🙂

  3. Mike Joes says:

    Hey, Thanks for the offer! I already made the sales page 10 days back or so but had to struggle alot. I’ll Surely try your suggestion and will definitely trouble you in case of doubts 😀

  4. Dennis Kean says:


    What a great idea. I have a friend who is blind, yet managed to create a WordPress website for himself. He tries to make money by writing articles and has marginal success. For him it is exhausting, though he has been writing quite a lot and made some marginal gain with affiliate programs. This may turn out to be useful to him. Any suggestions you may have are welcome. Being familiar with Python, I will recode this article search module for him so he can just make entries and read the articles before submitting them to his WrodPress.

    This is his site . I wonder if you have any ideas on this topic, his website or other ideas to throw at him. I’m trying to find a way to help him create something to become self reliant. I can do the programming for him. Just some good ideas would be very appreciated.

    Now about your video, once again, you found a way to make something I would never have tried to do on my own very interesting and engaging. And it seems so simple. So, I’m tooling up with python and testing it out.

    Thank you again,


    P.S. I will probably begin to annoy you with compliments, but you deserve them.

    • Derek Banas says:

      Hi Dennis, Feel free to ask questions. I actually make most of my money from running online stores. Your friend may be able to get into this. Most of my time is taken up with talking to suppliers on the telephone. I made everything for free here Create an Online Store.

      It costs almost nothing to get started (Hosting Plan / Domain) so if your friend isn’t in to it it isn’t a big deal. Either way I hope that helps.


  5. Stefan T says:

    SET UP A WEBSERVER integrated with PYTHON

    here are the suggestions that I have

    >>> use an Apache server

    >>> reading the web services article , I’ve concluded that WSGI is the way to go

    >>> so in order to use it with Apache, the module mod_wsgi is the most usable

    I have not set it up myself yet and haven’t started using it, but I will comment when I do and figure out more on how to use the module

    This framework is said to deliver performance similar to a multi-threaded server such as the integration between Apache and PHP, since CGI is not scalable.

    Hope that helps,

Leave a Reply

Your email address will not be published.