简体   繁体   中英

get DomXPath value by attribute “name”

I'm trying to get CIK codes from EDGAR . They don't give id s to their elements, but they at least give a name .

In this case, when there's a result, the page will have a hidden with name="CIK" .

I've got the page in a DOMDocument and that in a DomXPath . How do I get the value of that field?

Many thanks in advance!

Simple once you wind your way through the docs.

$CIK = $finder->query("//hidden[@name='CIK']");

Oh, I wouldn't use that though. Their html is nothing but a mess and gave errors all over the place.


Use this instead.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM