2

i want to parse from this exact line of code <a class="Icon IconDownload" href="javascript: void(0);" isfilelink="true" data-key="K7YyNbVScsvMSS3WNzAzNzEyMjWyiLc0NjY1NrfEFIk3MjA0jzcwjDfSK0hJU7IGAA==" THE VALUE K7YyNbVScsvMSS3WNzAzNzEyMjWyiLc0NjY1NrfEFIk3MjA0jzcwjDfSK0hJU7IGAA== and i don't know what to do.. Can anyone help me ?

This is what i have done so far:

$html = new simple_html_dom();
$html->load($response);

$anchors = $html->find('.IconDownload[data-key]');

foreach ($anchors as $anchor){
   echo $anchor->plaintext;
}

If i run this i get blank white screen.

2 Answers 2

1

This works fine and i get the results that i want

$html = new simple_html_dom();
$html->load($response);

$myArr = [];
foreach ($html->find('table a') as $anchor){

   $myArr[]= $anchor->attr['data-key'];
   $myArr[]= $anchor->attr['data-name'];


}

print_r($myArr);
Sign up to request clarification or add additional context in comments.

Comments

0

Try with:

$html = new simple_html_dom();
$html->load($response);

foreach ($html->find('a[class=IconDownload]') as $anchor){
   echo $anchor->attr['data-key'];
}

1 Comment

i am still getting a blank white screen. It worked on you ?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.