U
U
Us592019-04-15 20:36:16
PHP
Us59, 2019-04-15 20:36:16

How to retrieve table data?

I make a curl request to the site and get the html of the page, I need to pull out the data of 2 columns from the table and write it to an array. After searching the Internet, I understand it will be convenient to use the phpQuery library.
the table itself:
5cb4c0cb00997186889146.png
Problem:
As you can see in the photo in the td tag there is a script that is not needed, and also a text: 80 - you need to pull it out !!

$doc = phpQuery::newDocument($result);
foreach ($doc->find('#tblproxy') as $value) {
$value = pq($value);
$uuu= $value->find('tr td:nth-child(2)');
$ppp= $value->find('tr td:nth-child(3)');
}

and as a result I get:
5cb4c0ad19dea074859728.png
only I need the text, not the script!! the text see in the first picture should be the number 80.
How to get exactly the text?)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
Gip, 2019-04-16
@Giperoglif

yes, at least some substring from</script>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question