Get Element By id oder Namen in Curl

Mein Ziel-Website enthält code wie folgt

<form>
<input type="text" name="suggest" value="www.google.com">
<input type="submit" value="submit">
</form>

Bekomme ich diese Seite mit Curl Php

<?php
$url="http://mysite.com"; 
$ch = curl_init(); 
curl_setopt ($ch, CURLOPT_URL, $url); 
$result = curl_exec ($ch); 
echo $result;  
curl_close($ch);
?>

Wie bekomme ich den Wert des Elements mit der id oder dem Namen? Zum Beispiel "www.google.com" im input name="vorschlagen". Vielen Dank für die Hilfe.

Kann ich nicht verwenden Sie diesen code, um remote wie diese :

<?php
require 'Path/QueryPath.php';
qp('http://hipfile.com/bbgfom5ej9tm/zakhme_shaneie_haava_dvdrip.wmv.html/')-

find('[password="Anmeldung"]')->writeHTML();
?>

und senden Sie diese Fehler

Fatal error: Uncaught exception 'QueryPathParseException' with message 'DOMDocument::load() [domdocument.laden]: AttValue: "or' erwartet in http://hipfile.com/bbgfom5ej9tm/zakhme_shaneie_haava_dvdrip.wmv.html/, line: 18 (C:\xampplite\htdocs\test1\Path\QueryPath.php: 2106)' in C:\xampplite\htdocs\test1\Path\QueryPath.php:2346 Stack trace: #0 [internal function]: QueryPathParseException::initializeFromError(2, 'DOMDocument::lo...', 'C:\xampplite\ht...', 2106, Array) #1 C:\xampplite\htdocs\test1\Path\QueryPath.php(2106): DOMDocument->load('http://hipfile....', 0) #2 C:\xampplite\htdocs\test1\Path\QueryPath.php(179): QueryPath->parseXMLFile('http://hipfile....', NULL, NULL) #3 C:\xampplite\htdocs\test1\Path\QueryPath.php(23): QueryPath->__construct('http://hipfile....', NULL, Array) #4 C:\xampplite\htdocs\test1\index.php(3): qp('http://hipfile....') #5 {main} thrown in C:\xampplite\htdocs\test1\Path\QueryPath.php in Zeile 2346

Kann mir helfen? Früher habe ich zwei DOM-Und simplehtmldom aber nicht für mich arbeiten . es funktioniert für lokale Seite nur.

Dies könnte nützlich sein: simplehtmldom.sourceforge.net
QueryPath ist die neue simplehtmldom

InformationsquelleAutor behzad n | 2012-05-11

Schreibe einen Kommentar