このページの div からテキストを取得したい:
<html>
<head>Hello world!</head>
<body>
This is a test!<br>Hello man!<br>
<div class="special">
I want this text
</div>
</body>
</html>
このコードを使用して、タグなしでコンテンツを取得しています:
echo strip_tags(file_get_contents(' http://website.com '));
ただし、からコンテンツのみを取得したい
<div class="special">
そのページから。それはPHPで可能ですか?