Python Forum

Full Version: xml simple reader
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
sorry for my bad English,
I have scrapped a robots.txt from a website,
this is the trimmed/edited version of that txt
Quote:<img>gamepic1.jpg</img><title>game1</title>
<img>gamepic2.jpg</img><title>game2</title>
note:
1. the "gamepic2.jpg" and "game2" is gibberish that I made, the real data is a real jpg image and may or may not be similar to the jpg URL
2. the data line is about 200.000 lines with that format
so my question is: what is the simple solution so I get if I look for the title "game2", the gamepic2.jpg as img will appear
Please share URL
(Aug-19-2022, 01:24 PM)Larz60+ Wrote: [ -> ]Please share URL
sorry for the late reply,
I can provide it, but because it "adult" site, I'm afraid I will be banned if I show it
my problem is: what wise approach to get img and title from this line: <img>gamepic1.jpg</img><title>game1</title>
take note, the lines are about 200.000 lines,
should I create a database, or load it as text every time I need it, or something?