コード例 #1
0
import sys
sys.path.insert(0, r'C:\Users\yenaHan\SbaProjects')

from crawler.entity import Entity

from crawler.service import Service


class Controller:
    def __init__(self):
        self.entity = Entity()
        self.service = Service()


if __name__ == '__main__':
    mycolumns = ['타이틀 번호', '요일', '제목', '링크']
    filename = 'cartoon.csv'
    url = 'https://comic.naver.com/webtoon/weekday.nhn'
    new_folder_name = 'newfile'
    tag = 'div'
    attrs = 'thumb'
    replace_str = '/webtoon/list.nhn?'
    api = Controller()
    service = Service()
    service.get_url(url)
    service.create_folder_weekend(new_folder_name)
    service.setting_target(tag, attrs)
    service.loop_fun(replace_str, mycolumns, filename)
コード例 #2
0
import sys
sys.path.insert(0, '/Users/bumsu/SbaProject')
from crawler.entity import Entity
from crawler.service import Service


class Controller:
    def __init__(self):
        self.entity = Entity()
        self.service = Service()


if __name__ == '__main__':
    api = Controller()
    service = Service()

    soup_webtoon = service.get_url(
        'https://comic.naver.com/webtoon/weekday.nhn')
    service.naver_webtoon(soup_webtoon)

    soup_movie_rank = service.get_url(
        'https://movie.naver.com/movie/running/current.nhn')
    service.naver_movie_rank(soup_movie_rank)