Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
Websites/URLs to test code against
-
I am sorry in advance for this question. This does not really belong here. But does anyone know a website/URLs that one can test again for downloading images and lines of text. I have been looking and looking, I can't find anything. I thought that someone would have set up sites like this so you people could test their code against. RSS feeds are generally to small. 20 to 50 lines if you are lucky.
Again , sorry to ask, but I have a feeling someone here knows of something -
Why not start at http://news.google.com ? The main page will contain images and text. You can then crawl down each article URL to get longer chunks of text.
-
Thanks @ccc. I will give it a go. Previous attempts to access google pages before programmatically have result in an error, basically saying we know you are an app trying to read us :) but many websites these days go out of their way to protect their data, which is understandable. Have to start making use of my PythonAnywhere account. But just another thing to learn at the moment.
Anyway, thanks -
import bs4, requests url = 'http://news.google.com' soup = bs4.BeautifulSoup(requests.get(url).text) print(soup.prettify())
-
Thanks, I am trying that now with the img URLs. I found some code here that basically does the same. From an old posting you were working on.
-
Well, I am not trying it now. I have been refactoring my code :( sample data is fine, but can trip you up when you try to do something real. I have painted my self into a corner so to speak :) a lot to be said about design practices , yet another thing I have come to grips with
Even it's a personal comment, I don't mind to post. Without good design, you quickly find things going very wrong. -
-
@dgelessus , thank you! Exactly what I was looking for.