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

Trouble writing to database: RSS-reader

Hi!

I try to make a rss-reader in python just for fun, and I'm almost
finished. I don't have any syntax-errors, but when i run my program,
nothing happends.

This program is supposed to download a .xml-file, save the contents in
a buffer-file(buffer.txt) and parse the file looking for start-tags.
When it has found a start tag, it asumes that the content (between the
start-tag and the end-tag) is on the same line, so then it removes the
start-tag and the end-tag and saves the content and put it into a
database.

The problem is that i cant find the data in the database! If i watch
my program while im running it, i can see that it sucsessfuly
downloads the .xml-file from the web and saves it in the buffer.

But I dont think that i save the data in the correct way, so it would
be nice if someone had some time to help me.

Full code: http://pastebin.com/m56487698
Saving to database: http://pastebin.com/m7ec69e1b
Retrieving from database: http://pastebin.com/m714c3ef8

And yes, I know that there is rss-parseres already built, but this is
only for learning.
Jan 21 '08 #1
3 1143
Dennis Lee Bieber a écrit :
On Mon, 21 Jan 2008 08:12:43 -0800 (PST), Arne <ar******@gmail.com>
declaimed the following in comp.lang.python:
>The problem is that i cant find the data in the database! If i watch
my program while im running it, i can see that it sucsessfuly
downloads the .xml-file from the web and saves it in the buffer.
Did you COMMIT the transaction with the database?
Did you READ the code ?-)

NB : Yes, he did. The problem*s* are elsewhere.
Jan 21 '08 #2
On 21 Jan, 19:15, Bruno Desthuilliers <bruno.
42.desthuilli...@wtf.websiteburo.oops.comwrote:
This should not prevent you from learning how to properly parse XML
(hint: with an XML parser). XML is *not* a line-oriented format, so you
just can't get nowhere trying to parse it this way.

HTH
Do you think i should use xml.dom.minidom for this? I've never used
it, and I don't know how to use it, but I've heard it's useful.

So, I shouldn't use this techinicke (probably wrong spelled) trying to
parse XML? Should i rather use minidom?

Thank you for for answering, I've learnt a lot from both of you,
Desthuilliers and Genellina! :)

Jan 21 '08 #3
MRAB a écrit :
On Jan 21, 9:15 pm, Bruno Desthuilliers
<bdesth.quelquech...@free.quelquepart.frwrote:
>Arne a écrit :
(snip)
>>So, I shouldn't use this techinicke (probably wrong spelled)
May I suggest "technic" ?-)

That should be "technique"; just ask a Francophone! :-)
<mode="the usual frenchy">
My bad :(
</mode>
Jan 22 '08 #4

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

Similar topics

1
by: lawrence | last post by:
I can't get this page to show in Internet Explorer, so I assume the error is quite grave. I'm using a PHP script to write the RSS file. In Netscape the page shows up as plain text. "Item" is...
0
by: keith_h | last post by:
I am primarily a front-end designer and not familiar with ASP beyond breaking up pages into include files. Recently, one of my freelance clients wanted to display an RSS feed from his blog on his...
385
by: Xah Lee | last post by:
Jargons of Info Tech industry (A Love of Jargons) Xah Lee, 2002 Feb People in the computing field like to spur the use of spurious jargons. The less educated they are, the more they like...
4
by: Jonas Bush | last post by:
I've got the some code to try and validate some xml. Against my schema, the "Good" xml (below) produces a couple of warnings, which I don't care about. The "Bad" xml (also below), produces warnings...
0
by: Jake Barnes | last post by:
I've written a PHP script that makes an RSS feed for some mp3s so that the music studio I work for can offer some of its new music as a podcast. Often, after a podcast episode has gone live, and...
6
by: jimAH | last post by:
Hi all, I'm trying to add the tag <rss version="2.0"> </rss> to an xml file using asp. Any ideas on how to do this? I'm a XML / RSS newbie! I'm coming unstuck as (a) the tage contains a space...
3
by: shapper | last post by:
Hello, I need to add a XML file from an Access database. Could someone tell me what would be the best approach? Thanks, Miguel
1
by: John Wright | last post by:
I am running a console application that connects to an Access database (8 million rows) and converts it to a text file and then cleans and compacts the database. When it runs I get the following...
4
by: Billy Barth | last post by:
I would like to create a RSS feed from my Access Database. I have an Access table for news which has the article title, date, and story in it. What I would like to do is pull the data from there...
1
by: beaker | last post by:
Access Database-driven ASP page with embedded RSS feeds Hi, I know very little about web development in general - just some basic html scripting, CSS and a bit of XML. I've inherited a public...
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:
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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.