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

Thread: parse help

  1. #1
    Regular Coder
    Join Date
    Jan 2010
    Location
    Washington
    Posts
    223
    Thanks
    34
    Thanked 0 Times in 0 Posts

    Question parse help

    I am trying to grab the following information with my crawler and am having trouble with the format. I want to grab whatever number value is in this piece of html. like in this for example "148Mb".

    Code:
    <span class="size">| 148Mb</span>
    here is what im trying to use that is not working
    PHP Code:
    /<span class="size\"\>\| ([\d+\.]{0,12} [A-Za-z]{2})\<\/span\>/ 
    can someone help me get this correct please? Thanks.
    Last edited by cosmicsea; 01-24-2010 at 04:40 PM.

  • #2
    Regular Coder
    Join Date
    Jan 2010
    Location
    Washington
    Posts
    223
    Thanks
    34
    Thanked 0 Times in 0 Posts
    its not displaying what i typed correctly so here it is with no tags.
    /<span class\=\"size\"\>\| ([\d+\.]{0,12} [A-Za-z]{2})\<\/span\>/

  • #3
    Senior Coder
    Join Date
    Jul 2009
    Location
    South Yorkshire, England
    Posts
    2,318
    Thanks
    6
    Thanked 304 Times in 303 Posts
    Untested:

    Code:
    '#<span class\=\"size\"\>\|.*?([\d]{0,12}[a-z]{2})\<\/span\>#i'

  • Users who have thanked MattF for this post:

    cosmicsea (01-24-2010)

  • #4
    Regular Coder
    Join Date
    Jan 2010
    Location
    Washington
    Posts
    223
    Thanks
    34
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by MattF View Post
    Untested:

    Code:
    '#<span class\=\"size\"\>\|.*?([\d]{0,12}[a-z]{2})\<\/span\>#i'
    that seems to do alot more than what i had but it still is not grabbing the size.

  • #5
    Regular Coder
    Join Date
    Jan 2010
    Location
    Washington
    Posts
    223
    Thanks
    34
    Thanked 0 Times in 0 Posts
    nevermind it is working. there was an error with my coding. thanks alot for your help!


  •  

    Posting Permissions

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