我最近一直在用Python的Selenium包做一些工作,遇到了这种奇怪的HTML格式,这是我以前从未见过的(贴在下面)。从这个HTML页面源代码中,我想提取值'-26.507',但它没有明确的标识符。解决这个问题的最佳方法是什么?我考虑过使用xpath,但不确定如何正确实现它。你知道吗
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-US"><head>
<title>GEOID COMPUTATIONS</title>
<link rev="made" href="mailto:-bgcolor" />
<base href="http://www.ngs.noaa.gov/cgi-bin/GEOID_STUFF/geoid12B_single.prl" />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>
<body>
<h2>Output from GEOID12B</h2><pre> latitude longitude N error (95% confidence interval)
Station Name ddd mm ss.sssss ddd mm ss.sssss meters meters
USER LOCATION 28 0 0.00000 95 0 0.00000 -26.507 0.096
</pre>
</body></html>
目前没有回答
相关问题 更多 >
编程相关推荐