Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Quellcode auselesen

Empfohlene Antworten

Veröffentlicht

Hi

Kann mir einer sagen wo ich informationen finde wie ich einen quellcodes einer HTML seite auslesen kann mit hilfe von php.

hab hier im forum gesucht bin aber scheinbar zu blöd ein passenden suchbegriff einzugeben.

Gruß Nokinger

Hi,

da eine html eigentlich ja nichts anderes ist wie eine txt (der Text in Klartext vorliegt)

kannst du die Datei ja einfach mit php öffnen:

$inhalt = file("hello.html");

for($x = 0;$x < count($inhalt);$x++)

{

echo $inhalt[$x];

}

Gruß Scratch

Hi,

so wie jede andere Datei auch, nur das du als Pfad die komplette URL an gibst.

$handle = fopen ("http://www.example.com/", "r");

Gruß Jaraz

Hi,


<?php

$handle = fopen("http://www.bmw.de/","r");

$content = fread($handle,100);

fclose($handle);

echo $content;

echo "<br><br>";

?>
[/PHP]

gibt folgende fehler:

Warning: fopen(http://www.bmw.de/): failed to open stream: Bad file descriptor in \readhtml\index.php on line 3

Warning: fread(): supplied argument is not a valid stream resource in \readhtml\index.php on line 5

Warning: fclose(): supplied argument is not a valid stream resource in \readhtml\index.php on line 7

was mach ich falsch ????

Muss ich in der php.ini was einstellen ?? muss die gegenseite (bmw.de) irgendetwas erfüllen damit es geht ???

Gruß Scratch

Edit : Sorry habs etwas verpeilt

Das PHP Manual sagt folgendes:

Warning

When reading from network streams or pipes, such as those returned when reading remote files or from popen() and proc_open(), reading will stop after a packet is available. This means that you should collect the data together in chunks as shown in the example below.


<?php
$handle = fopen ("http://www.heise.de/", "rb");
$contents = "";
do {
$data = fread($handle, 8192);
if (strlen($data) == 0) {
break;
}
$contents .= $data;
} while(true);
fclose ($handle);
echo $contents;
?>
[/php]

Gruß Jaraz

PS: BMW arbeitet exessiv mit Frames und Javascript, das obige Bespiel ließt bei BMW zwar den Quelltext ein aber wenn du den normal ausgibst ohne die includierten Javascript Dateien kommt nur ein weißer Bildschirm.

Es könnte auch sein, das du in der firma hinter nem proxy + firewall sitzt und deshalb diese funktionen versagt bleiben.

dü müsstest dann die anfrage an den proxy senden der wiederum die sachen für dich aus dem internet holt.

Joa meci jungs ich hab eueren ersten versuch heute morgen getestetn ging aber nicht. Vermutung war die das ich hinter proxy und firewall hänge und es dann nicht geht, hab nun daheim getestet es funtzt danke für eire antworten denn habt ja fleißig ohne mich hier gepostet :)

gruß Nok

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.