Search Results

Search found 2 results on 1 pages for 'loclip'.

Page 1/1 | 1 

  • Prettify working using python idle but not when using python script

    - by Loclip
    So when I use print soup.prettify() on idle it's prettifying my html but when I calling the script from server the prettify() not working #!/usr/bin/python import cgi, cgitb, urllib2, sys from bs4 import BeautifulSoup styles = [] i = 1 site = "www.example.com" page = urllib2.urlopen(site) soup = BeautifulSoup(page) table = soup.find('table', {'class' :'style5'}) alltd = table.findAll('td') allspans = table.findAll('span') while i<55: styles.append("style" + str(i)) i+=1 for td in alltd: if any(x in td["class"] for x in styles): td["class"] = "align" for span in allspans: span.replaceWithChildren() print "Content-type: text/html" print print "<!DOCTYPE html>" print "<html>" print "<head>" print '<meta http-equiv="content-type" content="text/html; charset=utf-8">' print '<link rel="stylesheet" href="lightbox/css/lightbox.css" type="text/css" media="screen">' print '<style type="text/css">' print "body {background-color:#b0c4de;}" print '.align {text-align: center;}' print "</style>" print "</head>" print "<body>" print table.pretiffy() print "</body>" print "</html>"

    Read the article

  • How to make a checkbox list that is also explorer tree?

    - by Loclip
    Lets say we have 3 categories Car Airplanes Bikes Each category have other categories for example car have: BMW Toyota Mercedes Each of these categories have cars (no more categories) Car, airplane, bikes will be items in the listbox that can be explored and checked. Now lets say we explore car there will be BMW, Toyota, Mercedes that can be only checked. So if I check car all car will be checked, if i check bmw only the bmw from cars will be checked.. How I can do that?

    Read the article

1