파이썬 크롤링 중 링크 관련해서 질문드립니다.

조회수 72회

현재 kbo사이트를 크롤링 중인 학생입니다. https://www.koreabaseball.com/Record/Player/HitterDetail/Daily.aspx?playerId=70756 현재 해당 선수의 2002년부터 2018년의 일자별 크롤링을 진행하고 싶은데 링크가 저 부분 하나만 고정이 되어서 beautifulsoup를 쓰면 2018년도 하나밖에 크롤링이 되지 않습니다 2017년도 2016년도로 선택해서 넘어가도 링크가 아예 그대로고 ajax 랜더링 크롤링을 시도해보았지만 (설명링크 https://m.blog.naver.com/PostView.nhn?blogId=21ahn&logNo=221329219163&isFromSearchAddView=true) open in the new tab부분에서 다시 2018년도 페이지로 돌아가서 해당 kbo사이트를 크롤링 하는데 문제를 겪고 있습니다. 혹시라도 해결법이나 다른 크롤링 방법을 알고 계신다면 이를 공유해주신다면 정말로 감사드릴 것 같습니다. 읽어주셔서 감사합니다.

2 답변

  • ajax 아닙니다.

    https://www.koreabaseball.com/Record/Player/HitterDetail/Daily.aspx?playerId=70756

    post(body) 로 파라미터들을 넘깁니다.

    __EVENTTARGET   ctl00$ctl00$ctl00$cphContents$cphContents$cphContents$ddlYear
    __EVENTARGUMENT 
    __LASTFOCUS 
    __VIEWSTATE /wEPDwUKMjA5MDMwNTcyOA9kFgJmD2QWAmYPZBYCZg9kFgICAw9kFgJmD2QWAgIBD2QWAgIDD2QWCGYPZBYYZg8WAh4EVGV4dAW6ATxoNCBjbGFzcz0idGVhbSByZWd1bGFyLzIwMTkvZW1ibGVtX0hUIj48c3BhbiBjbGFzcz0nZW1iJz48aW1nIHNyYz0nLy9jcmRmY293anVyeG05ODQ4NjQuY2RuLm50cnVzcy5jb20vcmVzb3VyY2VzL2ltYWdlcy9lbWJsZW0vcmVndWxhci8yMDE5L2VtYmxlbV9IVC5wbmcnIC8+PC9zcGFuPktJQSDtg4DsnbTqsbDspog8L2g0PmQCAg8PFgQeCEltYWdlVXJsBSIvZmlsZS9wZXJzb24vbWlkZGxlLzIwMTkvNzA3NTYuanBnH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jEzPC90aD48dGg+MjU8L3RoPjx0aD41PC90aD48dGg+MDwvdGg+PHRoPjQ8L3RoPjx0aD4xNDwvdGg+PHRoPjE8L3RoPjx0aD4xPC90aD48dGg+ODwvdGg+PHRoPjI8L3RoPjx0aD4xMzwvdGg+PHRoPjE8L3RoPjx0aD4wLjMwNTwvdGg+PC90cj5kAgMPFgIfAwIWFixmD2QWAmYPFREFMDQuMDECTkMFMC42NjcBMwEwATIBMQEwATABMAEwATABMQEwATABMAUwLjY2N2QCAQ9kFgJmDxURBTA0LjAyAk5DBTAuNTAwATQBMQEyATEBMAExATIBMAEwATABMAEwATAFMC41NzFkAgIPZBYCZg8VEQUwNC4wNQJMRwUwLjAwMAEyATEBMAEwATABMAEwATABMAExATABMQEwBTAuNDQ0ZAIDD2QWAmYPFREFMDQuMDcCTEcFMC4wMDABMwEwATABMAEwATABMAEwATEBMAExATABMAUwLjMzM2QCBA9kFgJmDxURBTA0LjA4AktUBTAuMDAwATMBMAEwATABMAEwATABMQEwATEBMAEwATEFMC4yNjdkAgUPZBYCZg8VEQUwNC4wOQJLVAUwLjAwMAE0ATABMAEwATABMAExATABMAEwATABMgEwBTAuMjExZAIGD2QWAmYPFREFMDQuMTACS1QFMC4yMDABNQEwATEBMAEwATABMAEwATABMAEwATABMAUwLjIwOGQCBw9kFgJmDxURBTA0LjEyAlNLBTAuMDAwATIBMQEwATABMAEwATABMAEwATEBMQEwATAFMC4xOTJkAggPZBYCZg8VEQUwNC4xMwJTSwUwLjMzMwEzATABMQExATABMAEwATABMAExATABMQEwBTAuMjA3ZAIJD2QWAmYPFREFMDQuMTQCU0sFMC4yNTABNAEyATEBMAEwATEBMQEwATABMQEwATEBMAUwLjIxMmQCCg9kFgJmDxURBTA0LjE1BuuEpeyEvAUwLjUwMAE0ATEBMgExATABMAExATABMAExATABMQEwBTAuMjQzZAILD2QWAmYPFREFMDQuMTcG64Sl7IS8BTAuMDAwATQBMAEwATABMAEwATABMAEwATABMAEwATAFMC4yMjBk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j5kAgMPFgIfAwIXFi5mD2QWAmYPFREFMDUuMDEG65GQ7IKwBTAuMjUwATQBMQExATABMAExATEBMAEwATABMAEwATAFMC4zMDJkAgEPZBYCZg8VEQUwNS4wMwbroa/rjbAFMS4wMDABMwEwATMBMAEwATABMQEwATABMQEwATABMAUwLjMyNmQCAg9kFgJmDxURBTA1LjA0Buuhr+uNsAUwLjAwMAEzATABMAEwATABMAEwATABMAExATABMQEwBTAuMzE1ZAIDD2QWAmYPFREFMDUuMDYG64Sl7IS8BTAuNjY3ATMBMQEyATABMAExATEBMAEwATABMAExATAFMC4zMjZkAgQPZBYCZg8VEQUwNS4wNwbrhKXshLwFMC4yNTABNAEwATEBMAEwATABMAEwATABMAEwATABMAUwLjMyM2QCBQ9kFgJmDxURBTA1LjA4BuuEpeyEvAUwLjQwMAE1ATIBMgEwATABMAEwATABMAEwATABMgEwBTAuMzI3ZAIGD2QWAmYPFREFMDUuMTECS1QFMC43NTABNAEyATMBMwEwATABMgEwATABMAEwATABMAUwLjM0M2QCBw9kFgJmDxURBTA1LjEyAktUBTAuMjUwATQBMQExATABMAEwATABMAEwATABMAExATAFMC4zMzlkAggPZBYCZg8VEQUwNS4xMwbtlZztmZQFMC4zMzMBMwEwATEBMAEwATABMQEwATABMQEwATABMAUwLjMzOWQCCQ9kFgJmDxURBTA1LjE1Bu2VnO2ZlAUwLjI1MAE0ATABMQExATABMAExATABMAExATABMAEwBTAuMzM2ZAIKD2QWAmYPFREFMDUuMTcG65GQ7IKwBTAuNTAwATQBMQEyATABMAEwATABMAEwATABMAEyATAFMC4zNDFkAgsPZBYCZg8VEQUwNS4xOAbrkZDsgrAFMC4wMDABMwEwATABMAEwATABMAEwATABMAEwATABMgUwLjMzM2QCDA9kFgJmDxURBTA1LjE5BuuRkOyCsAUwLjAwMAEzATABMAEwATABMAEwATABMAEwATABMQEwBTAuMzI2ZAIND2QWAmYPFREFMDUuMjACU0sFMC41MDABNAEyATIBMAEwATEBMQEwATABMAEwATABMQUwLjMzMWQCDg9kFgJmDxURBTA1LjIxAlNLBTAuMjUwATQBMQExATABMAEwATABMAEwATABMAEwATAFMC4zMjhkAg8PZBYCZg8VEQUwNS4yMgJTSwUwLjMzMwEzATABMQExATABMAEwATABMAEwATABMAEwBTAuMzI5ZAIQD2QWAmYPFREFMDUuMjQG7IK87ISxBTAuMDAwATQBMAEwATABMAEwATABMAEwATABMAExATAFMC4zMTlkAhEPZBYCZg8VEQUwNS4yNQbsgrzshLEFMC4yNTABNAEwATEBMAEwATABMQEwATABMAEwATIBMAUwLjMxOGQCEg9kFgJmDxURBTA1LjI2BuyCvOyEsQUwLjAwMAE0ATABMAEwATABMAEwATABMAEwATABMQEwBTAuMzA5ZAITD2QWAmYPFREFMDUuMjcCTkMFMC4zMzMBMwExATEBMQEwATABMAEwATABMAExATABMAUwLjMxMGQCFA9kFgJmDxURBTA1LjI4Ak5DBTEuMDAwATEBMAExATABMAEwATEBMAEwATABMAEwATAFMC4zMTRkAhUPZBYCZg8VEQUwNS4yOQJOQwUwLjI1MAE0ATEBMQEwATABMQEzATABMAExATABMAEwBTAuMzEzZAIWD2QWAmYPFREFMDUuMzECTEcFMC4xNjcBNgExATEBMAEwATABMAEwATABMAEwATIBMAUwLjMwN2QCAg9kFgZmDxUBATZkAgEPFgIfAAXHATx0cj48dGggY29sc3Bhbj0iMiI+7ZWp6rOEPC90aD48dGg+MC4zMDY8L3RoPjx0aD44NTwvdGg+PHRoPjE4PC90aD48dGg+MjY8L3RoPjx0aD4zPC90aD48dGg+MDwvdGg+PHRoPjg8L3RoPjx0aD4yNDwvdGg+PHRoPjA8L3RoPjx0aD4wPC90aD48dGg+MTM8L3RoPjx0aD4xPC90aD48dGg+OTwvdGg+PHRoPjM8L3RoPjx0aD4wLjMwNzwvdGg+PC90cj5kAgMPFgIfAwIZFjJmD2QWAmYPFREFMDYuMDECTEcFMS4wMDABMwEwATMBMQEwATABMgEwATABMQEwATABMAUwLjMyMGQCAQ9kFgJmDxURBTA2LjAyAkxHBTAuMDAwATEBMAEwATABMAEwATABMAEwATEBMAEwATAFMC4zMThkAgIPZBYCZg8VEQUwNi4wMwbrhKXshLwFMC4wMDABMwEwATABMAEwATABMAEwATABMAEwATABMAUwLjMxMmQCAw9kFgJmDxURBTA2LjA1BuuEpeyEvAUwLjUwMAE0ATABMgEwATABMAEwATABMAEwATABMAEwBTAuMzE2ZAIED2QWAmYPFREFMDYuMDcG7ZWc7ZmUBTAuMzMzATMBMAExATABMAEwATABMAEwATEBMAEwATAFMC4zMTdkAgUPZBYCZg8VEQUwNi4wOAbtlZztmZQFMC4zMzMBMwExATEBMAEwATEBMwEwATABMQEwATABMAUwLjMxN2QCBg9kFgJmDxURBTA2LjA5Bu2VnO2ZlAUwLjQwMAE1ATEBMgEwATABMQEzATABMAEwATABMAEwBTAuMzE5ZAIHD2QWAmYPFREFMDYuMTAG7IK87ISxBTAuMjUwATQBMQExATABMAExATIBMAEwATABMAEwATEFMC4zMThkAggPZBYCZg8VEQUwNi4xMQbsgrzshLEFMC4wMDABNAEwATABMAEwATABMAEwATABMAEwATABMAUwLjMxMWQCCQ9kFgJmDxURBTA2LjEyBuyCvOyEsQUwLjY2NwEzATIBMgEwATABMQExATABMAExATABMAEwBTAuMzE3ZAIKD2QWAmYPFREFMDYuMTQG65GQ7IKwBTAuNzUwATQBMgEzATABMAExATIBMAEwATABMAEwATAFMC4zMjVkAgsPZBYCZg8VEQUwNi4xNQbrkZDsgrAFMC41MDABNAEyATIBMAEwATIBMgEwATABMAEwATIBMAUwLjMyOWQCDA9kFgJmDxURBTA2LjE2BuuRkOyCsAUwLjAwMAE1ATABMAEwATABMAEwATABMAEwATABMgEwBTAuMzIxZAIND2QWAmYPFREFMDYuMTcCTEcFMC4yNTABNAExATEBMAEwATABMQEwATABMAEwATABMAUwLjMxOWQCDg9kFgJmDxURBTA2LjE4AkxHBTAuMjUwATQBMAExATABMAEwATABMAEwATABMAExATAFMC4zMThkAg8PZBYCZg8VEQUwNi4xOQJMRwU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AEwATABMAEwATABMQEwATABMAUwLjMxMmQCAQ9kFgJmDxURBTA3LjAyBuuEpeyEvAUwLjAwMAE0ATABMAEwATABMAEwATABMAEwATABMAEwBTAuMzA3ZAICD2QWAmYPFREFMDcuMDMG64Sl7IS8BTAuNDAwATUBMAEyATABMAEwATABMAEwATABMAEwATAFMC4zMDlkAgMPZBYCZg8VEQUwNy4wNgJLVAUwLjQwMAE1ATEBMgEwATABMQEyATABMAEwATABMQEwBTAuMzExZAIED2QWAmYPFREFMDcuMDcCS1QFMC4wMDABMQExATABMAEwATABMAEwATABMAExATEBMAUwLjMxMGQCBQ9kFgJmDxURBTA3LjA4BuuRkOyCsAUwLjMzMwEzATEBMQEwATABMQEyATABMAEwATABMAEwBTAuMzEwZAIGD2QWAmYPFREFMDcuMDkG65GQ7IKwBTAuMDAwATQBMQEwATABMAEwATEBMAEwATEBMAEwATEFMC4zMDVkAgcPZBYCZg8VEQUwNy4xMAbrkZDsgrAFMC42MDABNQEyATMBMAEwATEBNAEwATABMAEwATABMAUwLjMxMWQCCA9kFgJmDxURBTA3LjEyAlNLBTAuMjUwATQBMAExATABMAEwATABMAEwATEBMAExATAFMC4zMTBkAgkPZBYCZg8VEQUwNy4xMwJTSwUwLjY2NwEzATEBMgEwATABMAExATABMAEwATEBMAEwBTAuMzE0ZAIKD2QWAmYPFREFMDcuMTQCU0sFMC41MDABMgEyATEBMAEwATABMAEwATABMQEwATABMAUwLjMxNWQCCw9kFgJmDxURBTA3LjE5Buuhr+uNsAUwLjI1MAE0ATEBMQExATABMAExATABMAExATABMQEwBTAuMzE0ZAIMD2QWAmYPFREFMDcuMjAG66Gv642wBTAuMjUwATQBMQExATEBMAEwATEBMAEwATEBMAEwATAFMC4zMTNkAg0PZBYCZg8VEQUwNy4yMQbroa/rjbAFMC4wMDABMwEwATABMAEwATABMAEwATABMAEwATEBMAUwLjMxMGQCDg9kFgJmDxURBTA3LjIyAk5DBTAuNzUwATQBMQEzATEBMAExATUBMAEwATABMAEw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CZg8VEQUwOC4wNQbsgrzshLEFMC4wMDABMQEwATABMAEwATABMAEwATABMAEwATABMAUwLjMwMWQCBA9kFgJmDxURBTA4LjA2BuyCvOyEsQUwLjY2NwEzATIBMgEwATABMQEzATABMAExATABMAEwBTAuMzA0ZAIFD2QWAmYPFREFMDguMDcG7IK87ISxBTAuMDAwATUBMAEwATABMAEwATABMAEwATABMAEwATAFMC4yOTlkAgYPZBYCZg8VEQUwOC4wOQbrkZDsgrAFMC4zMzMBMwEwATEBMAEwATABMAEwATABMAEwATABMAUwLjMwMGQCBw9kFgJmDxURBTA4LjEwBuuRkOyCsAUwLjI1MAE0ATEBMQEwATABMAEwATABMAEwATEBMAEwBTAuMjk5ZAIID2QWAmYPFREFMDguMTEG64Sl7IS8BTAuMDAwATMBMAEwATABMAEwATABMAEwATABMAEwATAFMC4yOTdkAgkPZBYCZg8VEQUwOC4xNAbtlZztmZQBLQEwATABMAEwATABMAEwATABMAExATABMAEwBTAuMjk3ZAIKD2QWAmYPFREFMDguMTYCS1QFMC43NTABNAEwATMBMQEwATABMQEwATABMQEwATABMAUwLjMwMmQCCw9kFgJmDxURBTA4LjE4Buuhr+uNsAUwLjIwMAE1ATABMQEwATABMAEwATABMAEwATABMQEwBTAuMzAwZAIMD2QWAmYPFREFMDguMTkG66Gv642wBTAuNzUwATQBMgEzATABMAExATIBMAEwATEBMAEwATAFMC4zMDVkAg0PZBYCZg8VEQUwOC4yMAJMRwUwLjUwMAEyATABMQEwATABMAExATABMAExATABMQEwBTAuMzA2ZAIOD2QWAmYPFREFMDguMjECTEcFMC4wMDABMgExATABMAEwATABMQEwATABMQEwATABMQUwLjMwNGQCDw9kFgJmDxURBTA4LjIzAk5DBTAuMDAwATEBMAEwATABMAEwATABMAEwATEBMAEwATAFMC4zMDRkAhAPZBYCZg8VEQUwOC4yNAJOQwUwLjI1MAE0ATEBMQEwATABMQExATABMAExATABMgEwBTAuMzAzZAIRD2QWAmYPFREFMDguMjUG7IK87ISxBTAuNTA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QEzATABMAEwATABMAEwBTAuMzAzZAIGD2QWAmYPFREFMDkuMDkCTkMFMC41MDABNAExATIBMAEwATEBMQEwATABMQEwATABMAUwLjMwNWQCBw9kFgJmDxURBTA5LjEwAktUBTAuNTAwATQBMgEyATABMAEwATABMAEwATABMAEwATEFMC4zMDdkAggPZBYCZg8VEQUwOS4xMQJLVAUwLjMzMwEzATEBMQExATABMAEwATABMAExATABMAEwBTAuMzA3ZAIJD2QWAmYPFREFMDkuMTMG64Sl7IS8BTAuNTAwATQBMQEyATABMAExATEBMAEwATABMAEwATAFMC4zMDlkAgoPZBYCZg8VEQUwOS4xNAbrhKXshLwFMC4wMDABNAEwATABMAEwATABMAEwATABMAEwATABMAUwLjMwNmQCCw9kFgJmDxURBTA5LjE1AkxHBTAuMDAwATMBMAEwATABMAEwATABMAEwATEBMAExATAFMC4zMDRkAgwPZBYCZg8VEQUwOS4xNgJMRwUwLjAwMAEzATABMAEwATABMAEwATABMAEwATEBMQEwBTAuMzAyZAIND2QWAmYPFREFMDkuMTgG7ZWc7ZmUBTEuMDAwATIBMAEyATABMAEwATEBMAEwATIBMAEwATAFMC4zMDVkAg4PZBYCZg8VEQUwOS4xOQbtlZztmZQFMC4yNTABNAExATEBMAEwATABMAEwATABMQEwATABMAUwLjMwNWQCDw9kFgJmDxURBTA5LjIwBuuEpeyEvAUwLjUwMAE0ATIBMgExATABMQExATABMAEwATABMAEwBTAuMzA2ZAIQD2QWAmYPFREFMDkuMjEG64Sl7IS8BTAuMjUwATQBMAExATABMAEwATABMAEwATABMAExATAFMC4zMDZkAhEPZBYCZg8VEQUwOS4yMwJOQwUwLjMzMwEzATEBMQEwATABMQE0ATABMAExATABMAExBTAuMzA2ZAISD2QWAmYPFREFMDkuMjUCS1QFMC41MDABMgExATEBMAEwATABMQEwATABMwEwATABMAUwLjMwN2QCEw9kFgJmDxURBTA5LjI3AkxHBTAuMjUwATQBMAExATABMAEwATABMAEwATABMAEwATAFMC4zMDZkAgYPZBYGZg8VA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qwL3tLyjHSMoYikS/BELIEyINHbvE7/UD/DTc8jNWrTBHiYW/LANNSszwV+Kpy98HWsqsGgURcHeODASKDry0S/0KJj3AC9g55GWsLI/aYy6+1sw15PqFUB3cu9NBTRSe6rbkn2/uH/1MJow5SS4628FQ+WLFIxLjZSP+UvCZ5alF7Z/0oiqXX8Yw2zxJ4DA1PfK1niuEc47lZyJj8HKe0jrcXOHA8B0qVw==
    ctl00$ctl00$ctl00$cphContents$cphContents$cphContents$ddlYear   2015
    ctl00$ctl00$ctl00$cphContents$cphContents$cphContents$ddlSeries 0
    

    __EVENTVALIDATION 파라미터가 항상 변화므로 받은 본문에서 항상 살펴봐야합니다.

    그외엔....특이사항은 없습니다.

    • 제가 파이썬으로 크롤링을 하는게 초보적이라 post(body)로 파라미터를 넘기라는 말이 무슨말인지 잘 모르겠습니다, 지금 현재 답변으로 주신 것이 해당선수의 2015년껄로 보이는데 코드를 어떻게 구성하셨는지 적어주시는게 가능하실까요? bluedice1217 2019.3.6 14:43
    • 코드요?....제가 시간이 나면 작성해볼게요...근데 requests 모듈을 사용해서 post 호출하면 되는 문제에요 정영훈 2019.3.6 18:32
  • 2018년 출력후 2015년 출력합니다.

    샘플에서 핵심은 변경되는 파라미터값을 찾아서 조회시 넣어줘야 합니다.

    import requests
    import bs4
    
    content = requests.get('https://www.koreabaseball.com/Record/Player/HitterDetail/Daily.aspx?playerId=70756').content
    soup = bs4.BeautifulSoup(content, "lxml")
    
    print(content.decode('utf-8')) # 2018 
    
    eventValidation = soup.find("input", id='__EVENTVALIDATION')['value']
    viewState = soup.find('input', id='__VIEWSTATE')['value']
    
    params = {'__EVENTTARGET':'ctl00$ctl00$ctl00$cphContents$cphContents$cphContents$ddlYear', '__VIEWSTATEGENERATOR':'07340454','__EVENTVALIDATION':eventValidation, '__VIEWSTATE':viewState, 'ctl00$ctl00$ctl00$cphContents$cphContents$cphContents$ddlYear': '2015', 'ctl00$ctl00$ctl00$cphContents$cphContents$cphContents$ddlSeries': '0'}
    
    content = requests.post('https://www.koreabaseball.com/Record/Player/HitterDetail/Daily.aspx?playerId=70756', params).content 
    
    print(content.decode('utf-8')) # 2015
    

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

Hashcode는 개발자들을 위한 무료 QnA 사이트입니다. 계정을 생성하셔야만 답변을 작성하실 수 있습니다.

(ಠ_ಠ)
(ಠ‿ಠ)

ᕕ( ᐛ )ᕗ
로그인이 필요합니다

Hashcode는 개발자들을 위한 무료 QnA사이트 입니다. 계정을 생성하셔야만 글을 작성하실 수 있습니다.