Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I want to get the date from this div:

<div class="pandatacontcol" style=" width:160px;">
    <h6>Date Qualified</h6>
    <p id="QualDate34868684">2013-03-08 12:04:01</p>
</div>

so output would be: 2013-03-08

I tried to do like that:

elements = doc.select("p[id^="QualDate"]");

but it doesn't work.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
151 views
Welcome To Ask or Share your Answers For Others

1 Answer

Try without quote marks

doc.select("p[id^=QualDate]");

Value of attribute is set inside quote marks <tag attribute="value">, but those quote marks are not part of value.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...