【问题标题】:parsing Javascript page using python [closed]使用python解析Javascript页面[关闭]
【发布时间】:2021-01-31 08:26:46
【问题描述】:

现在我正在尝试使用 python 创建一个 Javascript 页面解析器。

我尝试了很多 python 库,但我不能:(

谁能给我一个如何解析这个页面的例子: "https://help.zoho.com/portal/en/community/zoho-crm

我想获得问题正文,或者如果有人知道问题的名称也

(对不起我的英语) 任何建议

【问题讨论】:

标签: python parsing zoho


【解决方案1】:

谷歌python+selenium


from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.ui import WebDriverWait

url = 'https://help.zoho.com/portal/en/community/zoho-crm'

driver = webdriver.Chrome()
driver.get(url)

element = WebDriverWait(driver, 10).until(
    EC.presence_of_element_located(
        (By.CSS_SELECTOR, "div.TopicListLeftContainer__section"))
)

for idx, q in enumerate(driver.find_elements_by_css_selector('div.CommunityListItem__wrapper')):
    a = q.find_element_by_tag_name('a')
    t = q.find_element_by_css_selector('div.CommunityListItem__description')
    print(idx+1, a.text)
    print(t.text)
    print()

driver.quit()


【讨论】:

  • 贾斯汀·埃泽奎尔,谢谢!!!
猜你喜欢
  • 1970-01-01
  • 2010-09-28
  • 2020-09-20
  • 2023-03-10
  • 1970-01-01
  • 2011-06-23
  • 1970-01-01
  • 2010-11-05
  • 1970-01-01
相关资源
最近更新 更多