I have a question about Python crawling.

Asked 2 years ago, Updated 2 years ago, 131 views

Goals

When I tried to do goal 1, I kept getting errors when I tried to put it on the list right away, maybe because it was http address api So I have to convert them into str, but it's too cumbersome to do one by one and I can't think of a way.

Goal 2 has not been implemented yet. I think I can do this with my head, but it doesn't go my way.

Target 3 source code is below.

import requests
from bs4 import BeautifulSoup

def get_subjects():
    subjects = []

    req = requesets.get('view-source:http://www.saramin.co.kr/zf_user/jobs/relay/view-detail?rec_idx=36688317&rec_seq=0')
    html = req.text
    soup = BeautifulSoup(html, 'html.parser')
    divs = soup.findall('div', {"class" : "user_content"})

    for div in divs:
        links = div.findall()
    return subjects

I filled it up a little by reading various videos and writings. I made it using a Lle Jupiter laptop that uses different videos and different programs.

This code is designed to extract the div class from the frame source, but it is still incomplete.

likns = div.findall()
    for link in links:

I don't understand because this phrase keeps saying that it doesn't fit the grammar.

class needs:
    def __inif__(self, requirement, preference):
        self.requirement = requirement
        self.preference = preference
    def __str__(self):
        return self.requirement + self.preference

So I want to put it in this class and parse the contents in HTml

python crawling div html api

2022-09-21 18:23

1 Answers

Let me tell you what I can see.

def get_subjects():
    subjects = []
# Omitted
    for div in divs:
        Subjects.append(div) # Isn't this how you get the subjects to return?
    return subjects


2022-09-21 18:23

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.