Reputation: 49
I'm trying to parse some table data, but that table doesn't have class or fixed number so i'm trying to catch it by using the next_sibling()
method.
But if I find a standard table it returns null. Did I make a mistake in my code?
<table class="prettytable mx-auto rounded text-center">
This is that line I want to find.
And I tried both these codes:
$html_pokemon->find('table.prettytable.mx-auto.rounded.text-center')
$html_pokemon->find('table[class=prettytable mx-auto rounded text-center]')
What did I do wrong?
Upvotes: -1
Views: 338
Reputation: 76
First of all, you need to make a cURL request. And after that you can use SimpleDomHtml. You need to be connected with the page for parse and only then you will get the answer of your HtmlDom request. And you forgot about "file_get_html". If you use this one , find out the algorithm of its use.
Upvotes: 0