我正试图从美国证券交易委员会档案网站上提取以下信息
1)大型加速文件管理器 2) 加速文件管理器 3) 非加速文件管理器 4) 小型报告公司 5) 新兴成长型公司
以下是它在网站上的显示方式:
Large accelerated filer ☒
Accelerated filer ☐
Non-accelerated filer ☐ (Do not check if a smaller reporting company)
Smaller reporting company ☐
Emerging growth company ☐
在某些情况下,一个或多个项目可能不存在。我想编写一个通用代码,可以为许多公司提取这些值。现在我面临的问题是,HTML的结构正在随着公司的变化而变化。到目前为止,我遇到了3种不同的结构(请参见下面的HTML结构)。我如何编写代码来跨不同的结构进行泛化
<td valign="bottom">Large accelerated filer</td>
<td valign="bottom"> </td>
<td valign="bottom">☒</td>
<td valign="bottom"> </td>
<td valign="bottom">Accelerated filer</td>
<td valign="bottom"> </td>
<td valign="bottom">☐</td></tr>
<tr style="page-break-inside:avoid ; font-family:Times New Roman; font-size:10pt">
<td valign="bottom"><font style="white-space:nowrap">Non-accelerated filer</font></td>
<td valign="bottom"> </td>
<td valign="bottom">☐ (Do not check if a smaller reporting company)</td>
<td valign="bottom"> </td>
<td valign="bottom">Smaller reporting company</td>
<td valign="bottom"> </td>
<td valign="bottom">☐</td></tr>
<tr style="page-break-inside:avoid ; font-family:Times New Roman; font-size:10pt">
<td valign="bottom">Emerging growth company</td>
<td valign="bottom"> </td>
<td valign="bottom">☐</td>
<td valign="bottom"> </td>
<td valign="bottom"></td>
<td valign="bottom"> </td>
<td valign="bottom"></td></tr>
另一个结构:
filer <font style="FONT-FAMILY:WINGDINGS">x</font> Accelerated filer <font style="FONT-FAMILY:WINGDINGS">¨</font> Non-accelerated filer <font style="FONT-FAMILY:WINGDINGS">¨</font> Smaller reporting company <font style="FONT-FAMILY:WINGDINGS">¨</font> </font>
另一个:
<tbody><tr>
<td width="63%"></td>
<td valign="bottom" width="2%"></td>
<td width="35%"></td></tr>
<tr>
<td valign="top"> <p style="text-indent:2.00em"><font face="Times New Roman" size="2">Large accelerated filer <font face="WINGDINGS">¨</font></font></p></td>
<td valign="bottom"><font size="1"> </font></td>
<td valign="bottom"><font face="Times New Roman" size="2">Accelerated filer <font face="WINGDINGS">þ</font></font></td></tr>
<tr>
<td valign="top"> <p style="text-indent:2.00em"><font face="Times New Roman" size="2">Non-accelerated filer <font face="WINGDINGS">¨</font> (Do not check if a smaller reporting company)</font></p></td>
<td valign="bottom"><font size="1"> </font></td>
<td valign="bottom"><font face="Times New Roman" size="2">Smaller reporting Company <font face="WINGDINGS">¨</font></font></td></tr>
</tbody>
您可以尝试3个XPath的组合(|运算符),以获得所需的内容(已勾选的项目):
您提供的html格式不正确。如果不起作用,请提供其他内容
相关问题 更多 >
编程相关推荐