Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New to the CF scene
    Join Date
    Jan 2013
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Download Webpage content to txt

    Hey guys,
    I am totally lost here.

    Can anyone help me with a php code.
    I wanna download a webpage content to a txt file by entering the url.
    Is that possible?

    Thanks in advance for any help

  • #2
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,642
    Thanks
    0
    Thanked 649 Times in 639 Posts
    It can't be done with JavaScript and I don't think it can be done using a web browser.

    You'd need a separate program that can read web pages and convert them to text that runs outside of a browser. I don't know if such a program exists - probably not given the copyright issues associated with making it easier to steal text from web pages.
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.

  • #3
    Regular Coder
    Join Date
    Jan 2013
    Location
    Germany
    Posts
    578
    Thanks
    4
    Thanked 77 Times in 77 Posts
    What for?

  • #4
    New to the CF scene
    Join Date
    Jan 2013
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I want to count specific text strings in a web pages. So i thought it would be easier to download, search, count and deleted file would be easier that count online.
    If second solution is easier i wouldn't know

  • #5
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,843
    Thanks
    78
    Thanked 4,414 Times in 4,379 Posts
    Ummm...Felgall, look what he wrote:
    Can anyone help me with a php code.

    He doesn't want a JS solution. He just posted in the wrong forum.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •