当前位置:网站首页>51 data analysis post
51 data analysis post
2022-07-04 10:45:00 【She was your flaw】
51 Data analysis position
import csv
import time
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
# Launch the browser
browser = webdriver.Chrome()
# Access to web site
browser.get('https://www.51job.com/')
# Open window size
browser.set_window_size(1000, 800)
# Delay waiting
browser.implicitly_wait(10)
# Find the search box
search_input = browser.find_element(By.ID, 'kwdselectid')
# Enter search content
search_input.send_keys(' Data analysis ')
# Click enter
search_input.send_keys(Keys.ENTER)
# Select crawl data page
for page in range(1, 2):
browser.implicitly_wait(10)
# Sleep for a second
time.sleep(1)
# Position
titles = browser.find_elements(By.CSS_SELECTOR,
'body > div:nth-child(4) > div.j_result > div > div.leftbox > div:nth-child(4) > div.j_joblist > div > a > p.t > span.jname.at')
# Company name
names = browser.find_elements(By.CSS_SELECTOR,
'body > div:nth-child(4) > div.j_result > div > div.leftbox > div:nth-child(4) > div.j_joblist > div > div.er > a')
# Company type
business = browser.find_elements(By.CSS_SELECTOR,
'body > div:nth-child(4) > div.j_result > div > div.leftbox > div:nth-child(4) > div.j_joblist > div > div.er > p.int.at')
# Company conditions
claims = browser.find_elements(By.CSS_SELECTOR,
'body > div:nth-child(4) > div.j_result > div > div.leftbox > div:nth-child(4) > div.j_joblist > div > a > p.info > span.d.at')
# Release time
release_times = browser.find_elements(By.CSS_SELECTOR,
'body > div:nth-child(4) > div.j_result > div > div.leftbox > div:nth-child(4) > div.j_joblist > div > a > p.t > span.time')
for title, name, busines, claim, release_time in zip(titles, names, business, claims, release_times):
print(' Position :', title.text)
print(' Company name :', name.text)
print(' Company type :', busines.text)
print(' Conditions :', claim.text)
print(' Release time :', release_time.text)
# Save crawl data as CSV File for
with open(r'51job Data analysis position .csv', 'a', encoding='utf-8') as file:
writer = csv.writer(file)
writer.writerow([title.text, name.text, busines.text, claim.text, release_time.text])
if page < 1:
# Click next
browser.find_element(By.XPATH, '/html/body/div[2]/div[3]/div/div[2]/div[4]/div[2]/div/div/div/ul/li[last()]/a').click()
else:
break
边栏推荐
- /*Write a function to open the file for input, read the contents of the file into the vector container of string class 8.9: type, and store each line as an element of the container object*/
- [Galaxy Kirin V10] [desktop] printer
- Basic principle of servlet and application of common API methods
- Virtual machine configuration network
- Unittest+airtest+beatiulreport combine the three to make a beautiful test report
- For programmers, if it hurts the most...
- Write a thread pool by hand, and take you to learn the implementation principle of ThreadPoolExecutor thread pool
- [test theory] test process management
- Talk about scalability
- [Galaxy Kirin V10] [server] NFS setup
猜你喜欢
![[Galaxy Kirin V10] [desktop] build NFS to realize disk sharing](/img/72/5e725a44a50f152b477a4b2907a2d0.jpg)
[Galaxy Kirin V10] [desktop] build NFS to realize disk sharing

How do microservices aggregate API documents? This wave of show~

shell awk

Work order management system OTRs

Latex error: missing delimiter (. Inserted) {\xi \left( {p,{p_q}} \right)} \right|}}

C language - stack

Write a thread pool by hand, and take you to learn the implementation principle of ThreadPoolExecutor thread pool

TS type gymnastics: illustrating a complex advanced type

Application and Optimization Practice of redis in vivo push platform

system design
随机推荐
Press the button wizard to learn how to fight monsters - identify the map, run the map, enter the gang and identify NPC
If you don't know these four caching modes, dare you say you understand caching?
[Galaxy Kirin V10] [desktop and server] FRP intranet penetration
The most detailed teaching -- realize win10 multi-user remote login to intranet machine at the same time -- win10+frp+rdpwrap+ Alibaba cloud server
TS type gymnastics: illustrating a complex advanced type
Collection of practical string functions
Static comprehensive experiment ---hcip1
[Galaxy Kirin V10] [server] NFS setup
/*Write a function to open the file for input, read the contents of the file into the vector container of string class 8.9: type, and store each line as an element of the container object*/
/*The rewriter outputs the contents of the IA array. It is required that the type defined by typedef cannot be used in the outer loop*/
IPv6 comprehensive experiment
/*Rewrite the program, find the value of the element, and return the iterator 9.13: pointing to the found element. Make sure that the program works correctly when the element you are looking for does
[machine] [server] Taishan 200
Write a program that uses pointers to set all elements of an int array to 4.18: 0.
Personal thoughts on the development of game automation protocol testing tool
Add t more space to your computer (no need to add hard disk)
Snake (C language)
Huge number multiplication (C language)
Reasons and solutions for the 8-hour difference in mongodb data date display
Introduction to extensible system architecture