섹션6-3 '댓글' 질문드립니다!
359
작성한 질문수 5
섹션 6-3에서 for word in "멘트" <<
이렇게 돌리면 댓글이 한글자씩 입력하고 작성됩니다.
ex) 멘트
댓글1 : 멘 댓글2 : 트
if not device(text="이 게시물에 대한 댓글 기능이 제한되었습니다.").exists(): print("커멘드 작성 가능 exists") device(resourceId="com.instagram.android:id/layout_comment_thread_edittext").click()
for word in "안녕하세요!": device.send_keys(word) time.sleep(random.uniform(0.03,0.08)) time.sleep(5) device(resourceId="com.instagram.android:id/layout_comment_thread_post_button_click_area").click() time.sleep(2) device.press('back') time.sleep(2) device.press('back')
if not device(text="이 게시물에 대한 댓글 기능이 제한되었습니다.").exists(): print("커멘드 작성 가능 exists") device(resourceId="com.instagram.android:id/layout_comment_thread_edittext").click()
for word in "안녕하세요!": device.send_keys(word) time.sleep(random.uniform(0.03,0.08)) time.sleep(5) device(resourceId="com.instagram.android:id/layout_comment_thread_post_button_click_area").click() time.sleep(2) device.press('back') time.sleep(2) device.press('back')
답변 2
1
if not device(text="이 게시물에 대한 댓글 기능이 제한되었습니다.").exists():
print("커멘드 작성 가능 exists")
device(resourceId="com.instagram.android:id/layout_comment_thread_edittext").click()
for word in "안녕하세요!":
device.send_keys(word)
time.sleep(random.uniform(0.03,0.08))
time.sleep(5)
time.sleep(2)
device.press('back')
time.sleep(2)
device.press('back')
device(resourceId="com.instagram.android:id/layout_comment_thread_post_button_click_area").click()
위 코드로 변경하시면 작동될거에요 !
1
안녕하세요, 인프런 AI 인턴이에요.
질문 내용을 보니, 인스타그램 댓글 작성 코드를 작성하시려는 것으로 보입니다. for문에서 “멘트” 대신 “안녕하세요!“를 입력했을 때 댓글이 한글자씩 입력되는 문제가 발생하는 것으로 이해하였습니다.
이 경우, for문이 “안녕하세요!“에서 한 글자씩 반복되기 때문에, 매 반복마다 한 글자씩 입력되는 것 같아요. 이를 해결하려면, “안녕하세요!” 전체를 send_keys의 인자로 넣어서 한 번에 입력하도록 코드를 작성하면 될 것 같습니다.
아래는 수정된 코드 예시입니다.
if not device(text=“이 게시물에 대한 댓글 기능이 제한되었습니다.”).exists():
print(“커멘드 작성 가능 exists”)
device(resourceId=“com.instagram.android:id/layout_comment_thread_edittext”).click()
device.send_keys(“안녕하세요!”)
time.sleep(random.uniform(0.03,0.08))
time.sleep(5)
device(resourceId=“com.instagram.android:id/layout_comment_thread_post_button_click_area”).click()
time.sleep(2)
device.press(‘back’)
time.sleep(2)
device.press(‘back’)
다음과 같이 코드를 작성하시면, “안녕하세요!” 전체가 한번에 입력되어 댓글 작성이 가능할 것입니다.
아직도 문제가 발생한다면, 인스타그램 앱의 업데이트나 환경 설정 등을 다시 확인해보시는 것도 좋을 것 같아요. 감사합니다.
site:instagram.com -inurl:explore/tags -inurl:p -inurl:reel intitle:'{keyword}'" 이 코드는 이제 최신게시물을 불러오지 못합니다.
0
217
1
weditor에서
0
253
2
핸드폰으로 자동 클릭안됩니다.
0
547
2
로긴할 때 폰으로 보안코드 보낸거 입력하라는거요..
0
219
1
insta_mobile.py 링크만 무한루프 뜹니다. 왜 그런가요?
0
403
2
폰에 atx라는 자동차 모양 아이콘의 앱이 설치되었어요.
0
344
2
팔로워 리스트 추출완료 count 관련 문의드립니다.
0
424
2
휴대폰 로그인 패턴
0
267
2
리스트 추출만 반복
0
395
2
해시태그 검색 후 최근게시물 없음
0
2541
2
에러 확인 좀 부탁드립니다.
0
319
2
해시태그 검색 결과가 수강 내용과 달라서 올려주신 최종 코드가 적용되지 않고 오류가 납니다.
0
538
2
아직 질문 해결이 되지 못했습니다.
0
409
2
https://www.instagram.com/explore/tags/{keyword} 이상해요
0
522
2
윈도우와 맥 환경이 다른 점이 많아서 초기 환경설정부터 막혀있습니다 ㅜ
1
689
2
인스타 검색 부분이 변경 되어서...
1
466
2
Web 태그 접속후, 최근 사진 없습니다.?
0
381
2
계속 안됩니다..
1
321
2
insta_web 질문 있습니다!
1
1644
3
해시태그 추출
1
756
1
인스타그램 로그인 완료 후 검색 부분 (섹션 5 -3)
1
410
1
로그인 이후 발이 묶여서 멈추고 더이상 넘어가지 못하고 있습니다.
1
1092
3
MVWAER 질문 있습니다
0
315
1
모바일 인스타그램 접속 관련 질문
1
320
1





