parsing Javascript page using python

54 Views Asked by At

now I am trying to create a Javascript page parser using python.

I tried a lot of python libraries but I can't :(

Can someone give me an example of how to parse this page: "https://help.zoho.com/portal/en/community/zoho-crm

I want to get questions body or if someone knows how questions name too

(sorry for my English) ANY suggestions

1

There are 1 best solutions below

1
On BEST ANSWER

Google 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()