처음으로 건너 뛰기 을 건너 뛰고 싶습니다. 내가 바보. 코드 골프 한 번만 한 문장으로 한 줄 건너 뛰기
count = 0
for a in articles:
if count == 0:
count += 1
continue
data = a.b.c()
etc = a.abcde(E)
# ~~~~..........
코드
for c,l in enumerate(BeautifulSoup(requests.get(NS_URL, timeout=3).text, 'lxml').find_all('li')):
if c == 0: continue
link = l.a.get('href')
title = l.h1.a.text
img = l.img.get('src')
새로운 코드를 완성
for l in BeautifulSoup(requests.get(NS_URL, timeout=3).text, 'lxml').find_all('li'))[1:]:
link = l.a.get('href')
title = l.h1.a.text
img = l.img.get('src')
제가 문서를 사용하여 [1]. thx tyelaney
thx! 하지만 모르겠다. [1 ::] –
bert import itertools; D –
'기사'에 따라 itertools가 필요하지 않을 수도있다. 당신은''기사에서 [:] : ... '을 시도해보고 무슨 일이 일어나는 지 볼 수 있습니다. – tdelaney