Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Javascript searching webpage

Options
  • 14-11-2006 2:32pm
    #1
    Registered Users Posts: 42


    Hey folks. I'm looking to create a website that will search another website for work. It basically is looking to see if there is any of a certain type of file that is "Active". The files are marked as active beside the file name. If they are active, I want to be able to bring them up, each in a different window. I know how to bring them up in a different window but I need to know if there is a way of searching the page to bring up the web address of the active files. I tried using the likes of .charAt and .write but I can't seem to get my head around it.

    I'm just looking to see if it is even possible and if so, maybe to point me in the right direction of how to do this. I'm not looking for code, I'm looking for help.

    Thanks guys.


Comments

  • Registered Users Posts: 2,781 ✭✭✭amen


    If you are on site A searching Site B Jscript is not going to let you get at the files. Are you trying to write a web spider or crawler?
    Is the active in the name?
    If it isthen you could use charAt and IndexOf functions
    post more info pls


  • Registered Users Posts: 42 cake126


    Thanks Amen,

    If you can imagine the page like a webpage, the Active part would be in one of the columns and the link to the thing I'm trying to open would be in a seperate column but in the same row. So the active is not in the name but on the same line.

    I was thinking that there could be a pretty handy way of doing this if I could see the source code. If there was a handy way of viewing the source (automatically, as the page is ever changing) then I could probably use the charAt function to get the URL I need. It would be as simple as:
    -search sourse for incident of "Active" then after that, if "http://", pop out the URL.
    -repeat until end of document.

    So basically the problem as it stands is that I need to see the source. Any ideas?


  • Registered Users Posts: 378 ✭✭sicruise


    Why don't you use a server side application to get all the pages, parse the files and then display links to the relevent pages to the user... should be quite simple.


  • Registered Users Posts: 42 cake126


    Thanks Si but it actually turns out that we scrapped the whole idea. But your idea still kinda baffles me. You think I should have like taken the links from a server application and then parse them? I'm not really sure how I would go around doing that to be honest. I would have thought that simply searching the source would have been easier than going around it your way but that might have something to do with not fully understanding your method!

    Do you know if there is a simple way to pull the source code from a given webpage to, say, a text file?


Advertisement