검색 버튼을 클릭하면 제출하는 양식을 검토해야합니다. 양식은 검색어가 포함 된 GET 요청을 전송하지만 결과 목록 페이지로 리디렉션되며 결과 페이지의 URL에 검색어가 더 이상 포함되지 않습니다.
나는 성공적으로이 URL에 "코퍼스"검색 한 :
http://www.sciencedirect.com/science?_ob=QuickSearchURL&_method=submitForm&_acct=C000228598&_origin=home&_zone=qSearch&md5=61ce8901b141d527683913a240486ac4&qs_all=corpus
주 당신이해야 할 것이다하는 것을
- 이 시작 페이지를 다운로드 http://www.sciencedirect.com/
- 추출물 숨겨진 필드 검색 양식에서
- 숨겨진 필드에서 검색 URL을 조합하십시오.
- 보내기 GET 요청 검색 URL로
qs_all
필드에 검색 URL에 검색어를 추가
- 숨김으로이 URL에서
qs_all
다른 모든 필드를 제외하고
이 양식에서 오는 후속 리디렉션 전지. 내가 그것을 다운로드로 이 해당 양식의 소스 (이하 "코퍼스"검색 요청을 보내기 전에.) : 결과 페이지에서 결과의 수를 추출하는 방법으로 계속
<form name="qkSrch" method="get" target="_top" action="/science" style="margin:0px;">
<input type="hidden" name="_ob" value="QuickSearchURL">
<input type="hidden" name="_method" value="submitForm">
<input type="hidden" name="_acct" value="C000228598">
<input type="hidden" name="_origin" value="home">
<input type="hidden" name="_zone" value="qSearch">
<input type="hidden" name="md5" value="61ce8901b141d527683913a240486ac4">
<table border="0" width="100%" cellpadding="0" cellspacing="0" style="margin: 0;">
<tbody><tr valign="middle">
<!-- Code related for toggling labels -->
<td align="right"><label for="qs_all" id="fieldLabel"> All fields</label></td>
<td align="left"><input class="textbox qsinput xpstyle" type="text" name="qs_all" id="qs_all" value="" size="30" maxlength="450" title="For example: heart attack AND behavior?" tabindex="1"></td>
<td align="right"><label for="qs_author"> Author</label></td>
<td align="left" colspan="5"><input class="textbox qsinput xpstyle" type="text" name="qs_author" id="qs_author" value="" size="33" maxlength="450" title="e.g. J S Smith or John Smith or Smith JS" tabindex="2" style="_width:100%"></td>
<td nowrap="nowrap">
</td><td></td><td></td>
<td align="right" nowrap="nowrap" width="90%" valign="middle">
<a href="/science?_ob=MiamiSearchURL&_method=requestForm&_btn=Y&_acct=C000228598&_version=1&_urlVersion=1&_userid=10&md5=18a1082f74248d90d465ee65804fd7db" style="vertical-align:bottom;font-size:0.92em;">Advanced search</a>
</td>
</tr>
<tr>
<td align="right"><label for="qs_title"> Journal/Book title</label></td>
<td align="left"><input class="textbox qsinput xpstyle" type="text" id="qs_title" name="qs_title" value="" size="30" maxlength="450" title="For example: journal of molecular biology" tabindex="3"></td>
<td align="right" class="toggleQukSrch2"><label for="qs_vol" id="volField"> Volume</label></td>
<td align="left" class="toggleQukSrch"><input class="textbox qsinput xpstyle" type="text" name="qs_vol" id="qs_vol" value="" size="3" maxlength="10" style="width:30px;" tabindex="4"></td>
<td align="right" class="toggleQukSrch2"><label for="qs_issue" id="issueField"> Issue</label></td>
<td align="left" class="toggleQukSrch"><input class="textbox qsinput xpstyle" type="text" name="qs_issue" id="qs_issue" value="" size="3" maxlength="10" style="width:30px" tabindex="5"></td>
<td align="right" class="toggleQukSrch2"><label for="qs_pages" id="pageField"> Page</label></td>
<td align="right" class="toggleQukSrch"><input class="textbox qsinput xpstyle" type="text" name="qs_pages" id="qs_pages" value="" size="3" maxlength="10" title="For example: 14-27" style="width:30px" tabindex="6"></td>
<td align="right" nowrap="nowrap">
<input class="button" id="submit_search" type="Submit" alt="Submit Quick Search" title="Submit Quick Search" value="Search ScienceDirect" tabindex="8" name="sdSearch">
</td>
<td align="right" nowrap="nowrap" colspan="8" valign="bottom">
<a class="icon_qmarkHelpsci_dir" href="/science?_ob=HelpURL&_file=qs_tips.htm&_acct=C000228598&_version=1&_urlVersion=0&_userid=10&md5=2bd779305b31602341744eaa786e2f0a" target="sdhelp" onmouseover="window.status='Help is Available';return true" onmouseout="window.status='';return true" onclick="var helpWin;helpWin=window.open('/science?_ob=HelpURL&_file=qs_tips.htm&_acct=C000228598&_version=1&_urlVersion=0&_userid=10&md5=2bd779305b31602341744eaa786e2f0a','sdhelp','scrollbars=yes,resizable=yes,directories=no,toolbar=no,menubar=no,status=no,width=760,height=570');helpWin.focus();return false" tabindex="9" style="font-size:0.92em;padding-right:0;">Search tips</a>
</td>
</tr>
</tbody></table>
</form>
편집 .
귀하의 가정은 맞습니다. 코드의 다른 부분, 즉 결과 값의 수를 추출해야합니다.
앞의 예를 사용하십시오. "코퍼스"에서 검색하면 결과 페이지의 소스에서이 라인을 찾을 수 :
<input type="hidden" name="TOTAL_PAGES" value="2836">
을 그리고 당신은 그러므로 당신이 <input type="hidden" name="TOTAL_PAGES" value="
처럼 뭔가를 검색합니다 2836. 압축을하고 subequent 값을 얻을 것이다 닫는 따옴표 앞에.
VBA에서 코딩하는 방법을 알려주지는 않겠지 만 기본 String 조작이므로 처리 할 수 있기를 바랍니다.
스크래핑 대신 API에서이 정보를 얻을 수 있습니까? http : // www.developer.sciverse.com/ – JimmyPena