omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    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

    Pythonista
    testing
    3
    8
    4493
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Phuket2
      Phuket2 last edited by

      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

      1 Reply Last reply Reply Quote 0
      • ccc
        ccc last edited by

        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.

        1 Reply Last reply Reply Quote 0
        • Phuket2
          Phuket2 last edited by

          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

          1 Reply Last reply Reply Quote 0
          • ccc
            ccc last edited by

            import bs4, requests
            url = 'http://news.google.com'
            soup = bs4.BeautifulSoup(requests.get(url).text)
            print(soup.prettify())
            
            1 Reply Last reply Reply Quote 0
            • Phuket2
              Phuket2 last edited by

              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.

              1 Reply Last reply Reply Quote 0
              • Phuket2
                Phuket2 last edited by

                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.

                1 Reply Last reply Reply Quote 0
                • dgelessus
                  dgelessus last edited by

                  http://httpbin.org/

                  Phuket2 1 Reply Last reply Reply Quote 0
                  • Phuket2
                    Phuket2 @dgelessus last edited by

                    @dgelessus , thank you! Exactly what I was looking for.

                    1 Reply Last reply Reply Quote 0
                    • First post
                      Last post
                    Powered by NodeBB Forums | Contributors