springboot怎么把数据传给前端:springboot 如何引入前端 bootstrap?
这种问题网上一搜一大堆,你可以具体找一篇文章试试,遇到问题可以针对相关问题去提问。springboot通过jar包方式引入bootstrap_个人文章 - SegmentFault 思否 这不是查查就
顺晟科技
2022-10-18 13:20:07
112
Option Explicit
Sub VBAWebscraping2()
Dim IEObject As Object
Set IEObject = New InternetExplorer
IEObject.Visible = True
IEObject.navigate url:="https://streeteasy.com/building/" & Cells(2, 4).Value
Do While IEObject.Busy = True Or IEObject.readyState <> READYSTATE_COMPLETE
Application.Wait Now + TimeValue("00:00:01")
Loop
Dim IEDocument As HTMLDocument
Set IEDocument = IEObject.document
'GRAB by classname'
Dim IEElements As IHTMLElementCollection
Dim IEElement As IHTMLElement
Set IEElements = IEDocument.getElementsByClassName("details")
For Each IEElement In IEElements
If IEElement.innerText = "price" Then
Debug.Print (IEElement.innerText)
End If
Exit For
Next
'Dim lastRow As Long
'lastRow = Range("A" & Rows.count).End(xlUp).row
End Sub
它转到所需的位置,但当它试图提取价格时,它要么不在调试菜单中打印,要么抓取太多。试图找出一种更精确的方法来只抓住价格,很多教程都提到了ID标签,但在网站上并不多。
这就是我https://streeteasy.com/building/the-cambridge-500-east-85-street-new_york/15l?card=1
要找的网站。还尝试检索房间、浴室和邻居
的数量顺晟科技:
您可以使用类的价格
IEDocument.querySelector(".price").innerText
房间也一样
IEDocument.querySelector(".first_detail_cell").innerText
床
IEDocument.querySelector("[class='detail_cell ']").innerText
洗澡
IEDocument.querySelector("last_detail_cell").innerText
看看这些类是如何命名的,如果这些项目中的任何一个缺失或顺序不同,您在不同页面上的里程几乎肯定会有所不同。然后,您需要循环通过为类.detail_cell
选择而返回的元素列表,并测试.innerText
是否存在文本";room";,";bed"或";洗澡,并相应地分配。
05
2022-12
02
2022-12
02
2022-12
29
2022-11
29
2022-11
24
2022-11