Hi, I'm trying to extract certain things from a web page. The website is TVRage.com, and the example I'm using at the moment is [URL="http://www.tvrage.com/Warehouse_13/episode_list"]the Warehouse 13 episode list[/URL]. So far I've managed to get the title of the show using this code: [CODE]#!/usr/bin/env python import urllib def save_page(site="http://www.tvrage.com/Warehouse_13/episode_list"): mypath = site mylines = urllib.urlopen(mypath).readlines() f = open('temp2.txt', 'w') for item in mylines: f.write(item) f.close() def find_title(temp="temp2.txt"): f = open(temp, "r") site = f.read() f.close() search1 = "<title>" search2 = " (Episode" starter = site.find(search1) ender = site.find(search2) #print "Starts at %s and ends at %s" % (starter, ender) Just …

Member Avatar
Member Avatar
+0 forum 2

Hi, I'm pretty new to CakePHP, and have been managing so far. I've created a scraper that scrapes TV.com for episode information (episode number, airdate, title, description). The scraper works fine, and returns an array such as: [CODE]Array ( [0] => Array ( [name] => Stowaway [number] => 17 [description] => No synopsis available. Write a synopsis. [date] => 3/18/2011 [show_id] => 11 ) [1] => Array ( [name] => Os [number] => 16 [description] => While Walter attempts to figure out a way to stop the spread of vortexes on This Side, the team investigate a series of thefts …

Member Avatar
Member Avatar
+0 forum 3

Hi, I was trying to use my friend's hard drive the other day, but my Windows computer would not recognize it because it was in a Mac file format. I'm now trying to create a program (simple cli), pretty much a file folder, but that would be able to read (and eventually copy from) Mac and Linux file formatted drives as well. I'm still at the starting stages (I'm still a newbie) and I've been looking around the web trying to find a way to simply look at the drives connected to the computer. So far, the only way I've …

Member Avatar
Member Avatar
+0 forum 8

I know this is a easy problem to fix normally, but I've had no success yet. I have a Sony Vaio FW with Windows Vista, and a Maxent TV. I've connected the laptop to the tv with an HDMI cable. The image is displayed on the tv with no problem but there is no sound whatsoever. I've gone to the control panel and changed the default sound device to HDMI Device, still no success. I went into "Configure" and pressed on "Test", and it says it failed. I've also noticed that when I play a movie or anything at all …

Member Avatar
Member Avatar
+0 forum 3

Hi, I'm trying to take a date, add a day to it, and then convert it to a string. The date's format starts out like: '10/1/2009', and should end like: '2009-10-1'. I can do that part, but then I can't convert it to a date format and add a day. Here's what I have so far: [CODE] #!/usr/bin/env python import time import datetime epdate = episode_content[entry_number][index2+13:index3].replace('/', '-') #reformat so that the slashes are replaced epdate = epdate.split('-') #split the string into three epdate = epdate[2] + '-' + epdate[0] + '-' + epdate[1] #reorder the date to the correct format …

Member Avatar
Member Avatar
+0 forum 5

Hi, I'm making something of an RSS reader-ish. I'm using the [URL="http://www.feedparser.org/"]Universal Feed Parser[/URL] to do this. The feed is just a list of TV shows, and the date they air. I'm successful at getting the feed, now what i'm trying to do is split it up into chunks that I can manipulate. I'll give you the code bit by bit so as not to confuse too much (and I do apologize for such messy code): [CODE]def episode_info (feed_url): #get episode information, returns a dictionary """This is a function that is fed an xml feed and returns a dictionary holding …

Member Avatar
Member Avatar
+0 forum 2

Hi, I'm trying to get a list of the subjects that I'm getting from emails in gmail. I can get the subjects, but I can't seem to get them into a list. Here's my code so far: [CODE] #! usr/bin/env python import imaplib M=imaplib.IMAP4_SSL('imap.gmail.com', 993) M.login('user@gmail.com','password') M.select() typ, emails = M.search(None, 'ALL') subject = [] for email in emails[0].split(): typ, subjects = M.fetch(email, '(BODY[HEADER.FIELDS (SUBJECT)])') print '%s' % subjects[0][1] subject = subjects[0][1] M.close() M.logout() print subject [/CODE] The first print statement prints the subjects, but once I've added them to list 'subject', and try to print it, it only prints …

Member Avatar
Member Avatar
+0 forum 1

The End.