Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
假设共享的 html 不是真正使用的,我认为当第一个 TD 没有<a>标签时它会抛出异常。我认为你需要更新
<a>
if (tds.size() > 1)
作为
if (tds.size() > 1 && tds.get(0).select("a") != null && tds.get(0).select("a").first() ! null)
如果不是这种情况,共享NullPointerException源行号可以帮助更好地找到解决方案。
NullPointerException