执行<code> tag with PhantomJS

时间:2017-07-17 15:25:51

标签: java html selenium phantomjs

I already posted about this, but I've figured out a bit more about my problem so I'm making a new post. The piece of code I'm trying to evaluate is:

<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" style="display: none" class="datalet-bpr-guid-1790632">
<code style="display: none" id="bpr-guid-1790641">
  {"data":{ // lots of code...
{"$deletedFields":["courses","projects","description","recommendations","honors","entityLocale","organizations","region"],"locationName":"MyLocation","entityUrn":"urn:li:fs_position:(ACoAACJOkiYB8DxCiFxrW3EEdFpeIjMlZ2S84ck,997784449)","companyName":"MyCompany_Name","timePeriod":"urn:li:fs_position:(ACoAACJOkiYB8DxCiFxrW3EEdFpeIjMlZ2S84ck,997784449),timePeriod","company":"urn:li:fs_position:(ACoAACJOkiYB8DxCiFxrW3EEdFpeIjMlZ2S84ck,997784449),company","title":"MyTitle","companyUrn":"urn:li:fs_miniCompany:5163810","$type":"com.linkedin.voyager.identity.profile.Position"}, //more code...
</code>

In a browser, this code turns into a <ul> with <li> children containing the information I need in the "innerHTML" attribute. However, for some reason PhantomJS isn't executing this code and makes it nearly impossible to get the information I need. Is there any way to get PhantomJS to get the HTML that loads in the browser (I'm using Java to do this).

0 个答案:

没有答案