Как я могу соскрести карьеру названия заданий с этой страницы Javascript с помощью Python? < /p>
'https://www.dice.com/career-paths?title ... california ,%2Bus,%2BCA&experience=0&ssortby=siptEr У меня нет необходимых данных текстовых данных!import requests
from bs4 import BeautifulSoup
import json
import re
from selenium import webdriver
from selenium.webdriver.firefox.firefox_binary import FirefoxBinary
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
# get BeautifulSoup object
def get_soup(url):
"""
This function returns the BeautifulSoup object.
Parameters:
url: the link to get soup object for
Returns:
soup: BeautifulSoup object
"""
req = requests.get(url)
soup = BeautifulSoup(req.text, 'html.parser')
return soup
# get selenium driver object
def get_selenium_driver():
"""
This function returns the selenium driver object.
Parameters:
None
Returns:
driver: selenium driver object
"""
options = webdriver.FirefoxOptions()
options.add_argument('-headless')
driver = webdriver.Firefox(executable_path=r"geckodriver", firefox_options = options)
return driver
# get soup obj using selenium
def get_soup_using_selenium(url):
"""
Given the url of a page, this function returns the soup object.
Parameters:
url: the link to get soup object for
Returns:
soup: soup object
"""
options = webdriver.FirefoxOptions()
options.add_argument('-headless')
driver = webdriver.Firefox(executable_path=r"geckodriver", firefox_options = options)
driver.get(url)
driver.implicitly_wait(3)
html = driver.page_source
soup = BeautifulSoup(html, 'html.parser')
driver.close()
return soup
title = "PHP%2BDeveloper"
location = "San%2BDiego,%2BCalifornia,%2BUs,%2BCA"
years_of_experirence = "0"
sort_by_filter = "mostProbableTransition"
url = "https://www.dice.com/career-paths?title ... {}".format(title, location, years_of_experirence , sort_by_filter)
career_paths_page_soup = get_soup(url)
Подробнее здесь: https://stackoverflow.com/questions/597 ... ing-python
Как я могу соскребить карьеру названия заданий с этой страницы JavaScript с помощью Python ⇐ Python
-
- Похожие темы
- Ответы
- Просмотры
- Последнее сообщение
-
-
Очень медленное создание и инициализация заданий с использованием системы заданий Unity.
Anonymous » » в форуме C# - 0 Ответы
- 39 Просмотры
-
Последнее сообщение Anonymous
-
-
-
Получение снимков экрана и названия/названия приложения окна в Ubuntu 22.04 Wayland
Anonymous » » в форуме Linux - 0 Ответы
- 78 Просмотры
-
Последнее сообщение Anonymous
-