使用beauthoulsoup实现VBA到Python的转换

2024-09-28 04:22:23 发布

您现在位置:Python中文网/ 问答频道 /正文

page source

For Each hdiv In doc.getElementsByClassName("offset1 transport-plan location-detail well well-white margin20right")
                      For Each child In hdiv.Children
                         If child.tagName = "H4" Then
                            location = child.innerText    
                        ElseIf child.tagName = "TABLE" Then
                          If row.tagName = "TBODY" Then
                            For Each row1 In row.Children
                               do something

                           If row1.tagName = "TR" Then
                                For Each row2 In row1.Children
                                  If row2.innerText <> "" Then
                                    activity = row2.innerText

如何使用Beautifulsoup将VBA代码转换为Python

只想了解如何建立孩子的关系

我在试下面的东西

^{pr2}$

Tags: inchildforiflocationroweachrow1

热门问题