How to grab the directories and then write into excel?

Discussion in 'PHP' started by hhheng, Jul 21, 2008.

  1. #1
    hhheng, Jul 21, 2008 IP
  2. matthewrobertbell

    matthewrobertbell Peon

    Messages:
    781
    Likes Received:
    35
    Best Answers:
    0
    Trophy Points:
    0
    #2
    use a regular experession to pull all the links, write to a csv file.
    Cheers for the directory list, didn't know about that one;)
     
    matthewrobertbell, Jul 21, 2008 IP
  3. CristianR

    CristianR Peon

    Messages:
    704
    Likes Received:
    26
    Best Answers:
    0
    Trophy Points:
    0
    #3
    using a regular expression to pull all the links would either mean he'd to first strip the content of html tags and afterwards use a regular expression to fetch the links ( knowing that they have http:// in front of them - I can provide you with a regular expression for this ). After that I suggest taking a look at the PHP PEAR Excel writer ( just google it and you'll come up with some nice tutorials you could follow. )

    Hope this helps.
     
    CristianR, Jul 21, 2008 IP
  4. matthewrobertbell

    matthewrobertbell Peon

    Messages:
    781
    Likes Received:
    35
    Best Answers:
    0
    Trophy Points:
    0
    #4
    '/href="(.*?)"/', no stripping html needed.
     
    matthewrobertbell, Jul 21, 2008 IP
  5. CristianR

    CristianR Peon

    Messages:
    704
    Likes Received:
    26
    Best Answers:
    0
    Trophy Points:
    0
    #5
    yeah, but there are more links on that page - and I'm assuming he's only interested in the actual links on the page and not the "Submit here" links .. that's why I suggested he'd first have to strip the html tags...
     
    CristianR, Jul 22, 2008 IP
  6. matthewrobertbell

    matthewrobertbell Peon

    Messages:
    781
    Likes Received:
    35
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Ah, fair enough then
     
    matthewrobertbell, Jul 22, 2008 IP
  7. hhheng

    hhheng Banned

    Messages:
    2,633
    Likes Received:
    37
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Could you help me for that? Thanks a lot.
     
    hhheng, Jul 23, 2008 IP
  8. matthewrobertbell

    matthewrobertbell Peon

    Messages:
    781
    Likes Received:
    35
    Best Answers:
    0
    Trophy Points:
    0
    #8
    /<div align="left"><a href="(.*?)"/' should work
     
    matthewrobertbell, Jul 23, 2008 IP
  9. CristianR

    CristianR Peon

    Messages:
    704
    Likes Received:
    26
    Best Answers:
    0
    Trophy Points:
    0
    #9
    I don't get one thing though .. why you want to get that list from there .. isn't that your site ? you seem to have it in your signature ...

    anyway, if anyone is interested in the list just PM me.
     
    CristianR, Jul 24, 2008 IP
  10. tgkprog

    tgkprog Peon

    Messages:
    28
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #10
    u can also just write it as a csv but name it xyz.xls excel opens it and shows it as a excel if u save it prompts u on format
     
    tgkprog, Jul 24, 2008 IP