저는 대학에서 연구중인 infoweb.newsbank.com의 데이터베이스에서 기사를 수집하려고합니다. 내가 다시이 응답을 얻을쿠키가 필요한 웹 사이트의 Python 기사 모음
from bs4 import BeautifulSoup
import requests
import urllib
from requests import session
import http.cookiejar
mainLink = "http://infoweb.newsbank.com.proxy.lib.uiowa.edu/iw-search/we/InfoWeb?p_product=AWNB&p_theme=aggregated5&p_action=doc&p_docid=14D12E120CD13C18&p_docnum=2&p_queryname=4"
def articleCrawler(mainUrl):
response = urllib.request.urlopen(mainUrl)
soup = BeautifulSoup(response)
linkList = []
for link in soup.find_all('a'):
print(link)
articleCrawler(mainLink)
Unfortunatrly : 지금까지 내 코드입니다 내가 http.cookiejar를 사용하려고했습니다
<html>
<head>
<title>Cookie Required</title>
</head>
<body>
This is cookie.htm from the doc subdirectory.
<p>
<hr>
<p>
Licensing agreements for these databases require that access be extended
only to authorized users. Once you have been validated by this system,
a "cookie" is sent to your browser as an ongoing indication of your authorization to
access these databases. It will only need to be set once during login.
<p>
As you access databases, they may also use cookies. Your ability to use those databases
may depend on whether or not you allow those cookies to be set.
<p>
To login again, click <a href="login">here</a>.
</p></p></p></hr></p></body>
</html>
<a href="login">here</a>
을, 그러나 나는 도서관에 익숙하지 않다. 파이썬 3을 사용하고 있습니다. 누구든지 쿠키를 수락하고 기사에 액세스하는 방법을 알고 있습니까? 고맙습니다.
좋아, 나중에 확인하고 나중에 댓글을 달아 보겠습니다. 고맙습니다. –