0

スクリプトで次のコードを使用して、必要なソースコードの一部を取得していますが、このエラーが発生します

解析エラー: 構文エラー、予期しない T_ENCAPSED_AND_WHITESPACE、151 行目の /home/cyberhos/public_html/CH/tes.php の ')' が必要です

simple_html_dom.php は、スクリプトの他の場所で既に発行されています

        if (isset($_POST['mp'], $_POST['delim'], $_POST['submit'])) {
        $mps = preg_split('/\r\n|\r|\n/', $_POST['mp']);

        // Create an array to store results
        $result_data = array();

        // Iterate over requests
        foreach ($mps as $mp) {
            $mp = explode($_POST['delim'], $mp);

            // Store the account details in variables
            list($email, $password) = $mp;

            // Get HTML data
            $html_string = checkmail($email, $password);
            $html = str_get_html($html_string);
            $body = $html->find('div[id="welcome_text"]);
            // Prepare a reusable string
            $result_string = "Checked " . $email .  " : " . $password . " is ";

            // Append necessary word to it
            if ($html>welcome_text === "Welcome to Tesco.com. We hope that you enjoy your visit.") {
                $result_string .= "LIVE";
            } else {
                $result_string .= "DEAD";
            }

このエラーを修正するにはどうすればよいですか?スクリプトが正しく動作するように、このエラーを修正する方法はありますか?

私が取得しようとしているソースコードの一部です

<div id="welcome_text" class="">
<div class="box">

Welcome to Tesco.com. We hope that you enjoy your visit.
<a id="ctl00_ctl00_lnkLogin" href="javascript:__doPostBack('ctl00$ctl00$lnkLogin','')">Log out</a>
</div>
4

1 に答える 1

1

'編集されたこの行で見逃しているのは

 $body = $html->find('div[id="welcome_text"]');

編集したコード

 if (isset($_POST['mp'], $_POST['delim'], $_POST['submit'])) {
    $mps = preg_split('/\r\n|\r|\n/', $_POST['mp']);

    // Create an array to store results
    $result_data = array();

    // Iterate over requests
    foreach ($mps as $mp) {
        $mp = explode($_POST['delim'], $mp);

        // Store the account details in variables
        list($email, $password) = $mp;

        // Get HTML data
        $html_string = checkmail($email, $password);
        $html = str_get_html($html_string);
        $body = $html->find('div[id="welcome_text"]');
        // Prepare a reusable string
        $result_string = "Checked " . $email .  " : " . $password . " is ";

        // Append necessary word to it
        if ($html>welcome_text === "Welcome to Tesco.com. We hope that you enjoy your visit.") {
            $result_string .= "LIVE";
        } else {
            $result_string .= "DEAD";
        }
    }
}
于 2013-04-29T09:42:52.737 に答える