고등학생 파이썬 프로젝트 질문입니다 ㅠ

조회수 366회
print('몇회차부터 몇회차 까지의 번호를 메모장에 저장하고 싶숩니까?')
a,b = int(input().split(' '))
with open('{}~{}.txt'.format(a, b), 'w', encoding='UTF-8') as f:
    for i in range(a,b+1):
        lotto_url = "https://dhlottery.co.kr/gameResult.do?method=byWin"
        lotto_get = req.get(lotto_url, params={"method":"byWin","drwNo":"{}".format(i)})
        spoon = bs(lotto_get.content, 'lxml')
        get_win_num = []
        get_bonus_num = 0
        for num in spoon.select('.win span'):
            get_win_num.append(num.text)
        for num in spoon.select('.bonus span'):
            get_bonus_num = num.text
        for number in get_win_num:
            f.write(number)
        f.write(get_bonus_num)
        f.write('\n')

이 코드에서 메모장에 로또 번호와 보너스 번호를 지정한 회차만큼 받아오고 싶은데 왜 틀렸는지 알 수 있을까요 ㅠㅠ

  • 에러 코드를 올려주세요. 초보자 2022.6.9 15:33

1 답변

답변을 하려면 로그인이 필요합니다.

프로그래머스 커뮤니티는 개발자들을 위한 Q&A 서비스입니다. 로그인해야 답변을 작성하실 수 있습니다.

(ಠ_ಠ)
(ಠ‿ಠ)