extract body-content from HTML page online

Ask a Question related to PHP Programming, Design and Development.

  1. #1

    Default extract body-content from HTML page online

    Hi everybody,

    I need to include an online web page in my own one. My first attempt was to
    include() that page. This way all the HTML framework has been included, too.
    I'd prefer to include the data inside the body-tags only. What's the best
    way to do so?

    Regards,
    Carl


    Carl Melot Guest

  2. Similar Questions and Discussions

    1. How to make newbie edit text online on a static HTML page? CMS mandatory?
      recipe: a splash of PHP, a smidgen od MySQL mix together with a page or pages that add, update and delete news items and away you go..... ...
    2. How to update the content of an HTML page in ASP .Net
      Hi everyone, I have the following HTML code and I like to change the value of REFRESH content from 2 to something else at runtime. Any...
    3. [PHP] Extract a little string from a Html page ?
      I tried something else but... It doesn't work too :-( . <? php $fichier=implode('',array_map('trim',readfile("http://myurl.com"))); if (eregi...
    4. How to insert dynamically generated HTML into the <body> of an ASP.NET page?
      I need to generate a "buy" button as part of an ASP.NET page - this consists of a small HTML form with hidden fields, conforming to the requirements...
    5. Inserting dynamic content into an HTML page
      Hi Can anyone tell me how to insert, within an html page, content that is returned from an asp page on another server? I've seen it done like...
  3. #2

    Default Re: extract body-content from HTML page online

    Carl Melot wrote:
    > I need to include an online web page in my own one. My first attempt
    > was to include() that page. This way all the HTML framework has been
    > included, too. I'd prefer to include the data inside the body-tags
    > only. What's the best way to do so?
    >
    <?
    $file = file_get_contents("http://www.google.com");
    $body = preg_replace("/.*<body[^>]*>|<\/body>.*/si", "", $file);
    ?>


    JW



    Janwillem Borleffs Guest

  4. #3

    Default Re: extract body-content from HTML page online


    Janwillem Borleffs wrote...
    > $body = preg_replace("/.*<body[^>]*>|<\/body>.*/si", "", $file);
    Thanks a lot!

    Carl


    Carl Melot Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139