我需要通过在 watir 中运行多个页面的多个搜索结果来模拟用户搜索。因此,假设我搜索产品并获得 35 个搜索结果(每页 10 个搜索结果),我需要单击查看产品,转到详细的产品页面并返回搜索页面。
我们正在开发的这个站点与linkedin非常相似,所以我在这里附上了一个linkedin html。挑战是我需要在 html 中识别类似于以下https://linkedin.com/view=1324526的模式?...现在由于有很多链接,我如何识别这种特定模式并单击产品/配置文件。另外,一旦我到达个人资料,我如何返回搜索结果。请注意,linkedin 之间有很多巧合,所以我以linkedin 为例。如果它类似于linkedin,我可以轻松修改脚本。谢谢
</li>
<li class="vcard expanded-view " id="vcard-8">
<div class="result-data">
<div class="actions">
<a href="http://www.linkedin.com/people/invite?from=profile&key=39198881&firstName=Sharon&lastName=Monteiro&authToken=MrLR&authType=OUT_OF_NETWORK&pvs=ps&trk=pp_invite_member_action&goback=%2Efps_PBCK_instructor_*1_*1_*1_*1_*1_*1_*2_*1_Y_*1_*1_*1_false_1_R_*1_*51_*1_*51_true_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2" class="primary-action trk-invite-member connecticon" name="_inviteLink"><strong>Connect</strong></a>
<div class="dropdown action-dropdown">
<h3>See all results »</h3>
<ul class="drop action-dropdown-list">
<li>
<a href="/requestList?destID=39198881&creationType=REFERRAL&displayProposal=&pvs=ps&trk=pp_get_intro_action&goback=%2Efps_PBCK_instructor_*1_*1_*1_*1_*1_*1_*2_*1_Y_*1_*1_*1_false_1_R_*1_*51_*1_*51_true_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2" class="external-link trk-get-intro" name="_getIntroducedLink"> Get introduced </a>
</li>
<li>
<a href="/requestList?destID=39198881&creationType=DC&displayProposal=&pvs=ps&authToken=MrLR&authType=OUT_OF_NETWORK&trk=pp_send_inmail_action&goback=%2Efps_PBCK_instructor_*1_*1_*1_*1_*1_*1_*2_*1_Y_*1_*1_*1_false_1_R_*1_*51_*1_*51_true_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2" class="external-link trk-send-inmail" name="_sendInMailLink"> Send InMail </a>
</li>
<li>
<a href="/forwardProfileMsg?displayCreate=&profileID=39198881&profileName=Sharon+Monteiro&network=I&authToken=MrLR&authType=OUT_OF_NETWORK&trk=pp_share_profile_action" class="external-link trk-share-profile" name="_shareProfileLink"> Share Profile </a>
</li>
<li class="one-click">
<a href="#" class="trk-find-references" name="vcard-8">Find references</a>
</li>
</ul>
</div>
</div>
<a href="/profile/view?id=39198881&authType=OUT_OF_NETWORK&authToken=MrLR&locale=en_US&srchid=26e4d6f3-1ee3-436f-b006-395fded1f576-0&srchindex=9&srchtotal=1317249&goback=%2Efps_PBCK_instructor_*1_*1_*1_*1_*1_*1_*2_*1_Y_*1_*1_*1_false_1_R_*1_*51_*1_*51_true_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2&pvs=ps&trk=pp_profile_photo_link" class="profile-photo external-link trk-profile-photo" target="_top" tracking="hb_upphoto" data-li-larger-profile="http://media01.linkedin.com/media/p/2/000/053/26a/23e1360.jpg">
<img src="http://media03.linkedin.com/mpr/mpr/shrink_60_60/p/2/000/053/26a/23e1360.jpg" class="photo" alt="Sharon Monteiro" width="60" height="60">
<span class="larger-profile-photo-control"></span>
</a>
<h2>
<a href="/profile/view?id=39198881&authType=OUT_OF_NETWORK&authToken=MrLR&locale=en_US&srchid=26e4d6f3-1ee3-436f-b006-395fded1f576-0&srchindex=9&srchtotal=1317249&goback=%2Efps_PBCK_instructor_*1_*1_*1_*1_*1_*1_*2_*1_Y_*1_*1_*1_false_1_R_*1_*51_*1_*51_true_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2&pvs=ps&trk=pp_profile_name_link" class="fn n external-link trk-profile-name" title="View Profile" target="_top">
Sharon Monteiro
</a>
<span class="badges">
<abbr title="Sharon Monteiro is a 2nd degree contact"><span class="network-degree">2<sup>nd</sup></span></abbr>
</span>
<span class="saved-profile">
<a href="/organizer?trk=subpro_goto_srch" >Saved</a>
</span>
</h2>
<a href="/profile/view?id=39198881&authType=OUT_OF_NETWORK&authToken=MrLR&locale=en_US&srchid=26e4d6f3-1ee3-436f-b006-395fded1f576-0&srchindex=9&srchtotal=1317249&goback=%2Efps_PBCK_instructor_*1_*1_*1_*1_*1_*1_*2_*1_Y_*1_*1_*1_false_1_R_*1_*51_*1_*51_true_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2&pvs=ps" class="url">View Profile</a>
<dl class="vcard-basic">
<dt>Title</dt>
<dd class="title">Life Coach whose specializes in transforming people's lives with NLP, Theta Healing, Coaching, EFT,</dd>
<dt class="demographic-info">Demographic info</dt>
<dd class="location-industry">
<span class="location">
United Arab Emirates
</span>
<span class="separator">·</span>
<span class="industry">
Think Tanks
</span>
</dd>
<dt class="network-information">Network Information</dt>
<dd class="connections-recommendations">
91 connections
<span class="separator">·</span>
1 recommendation
</dd>
</dl>
<dl class="vcard-expanded">
<dt class="current">Current:</dt>
<dd class="show-less-text">
<span class="current-details less-text">Educator, Trainer, Speaker, Writer ... <span class="toggle-show-more">more</span></span>
<span class="current-details more-text">Educator, Trainer, Speaker, Writer at Releasing With Love <span class="toggle-show-less">less</span></span>
</dd>
<dt class="past">Past:</dt>
<dd class="show-less-text">
<span class="past-details less-text">Head <strong class="highlight">Instructor</strong> at Releasing With ... <span class="toggle-show-more">more</span></span>
<span class="past-details more-text">Head <strong class="highlight">Instructor</strong> at Releasing With Love <span class="toggle-show-less">less</span></span>
</dd>
<dt class="incommon-connections">In Common:</dt>
<dd>
<span>
<a href="/profile/view?id=39198881&authType=OUT_OF_NETWORK&authToken=MrLR&locale=en_US&srchid=26e4d6f3-1ee3-436f-b006-395fded1f576-0&srchindex=9&srchtotal=1317249&goback=%2Efps_PBCK_instructor_*1_*1_*1_*1_*1_*1_*2_*1_Y_*1_*1_*1_false_1_R_*1_*51_*1_*51_true_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2&pvs=ps&trk=pp_shared_conn_link" name="vcard-8" class="toggle-shared-connections trk-shared-conn-link trk-no-external" title="View your shared connections"> <strong>1</strong> shared connection</a>
<span class="separator">·</span>
<a title="View similar people" target="_top" class="similar trk-similar" href="/search/fpsearch?viewType=sim&sId=39198881&trk=psearch_similar">Similar</a>
</span>
</dd>
</dl>
<div class="shared-connections">
<h3>Shared Connections</h3>
<div class="progress-indicator"><img src="http://static01.linkedin.com/scds/common/u/img/anim/anim_loading_16x16.gif" width="16" height="16" alt="Loading"></div>
<ul>
</ul>
<p class="error-msg">
<span class="error">There was an error loading your shared connections. Refresh the page and try again.</span>
</p>
</div>
</div>
</li>
<li class="vcard expanded-view " id="vcard-9">
<div class="result-data">
<div class="actions">
<a href="/requestList?destID=82828415&creationType=DC&displayProposal=&pvs=ps&authToken=uja0&authType=OUT_OF_NETWORK&trk=pp_send_inmail_action&goback=%2Efps_PBCK_instructor_*1_*1_*1_*1_*1_*1_*2_*1_Y_*1_*1_*1_false_1_R_*1_*51_*1_*51_true_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2" class="primary-action trk-send-inmail messageicon" name="_sendInMailLink"><strong>Send InMail</strong></a>
<div class="dropdown action-dropdown">
<h3>See all results »</h3>
<ul class="drop action-dropdown-list">
<li>
<a href="/requestList?destID=82828415&creationType=REFERRAL&displayProposal=&pvs=ps&trk=pp_get_intro_action&goback=%2Efps_PBCK_instructor_*1_*1_*1_*1_*1_*1_*2_*1_Y_*1_*1_*1_false_1_R_*1_*51_*1_*51_true_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2" class="external-link trk-get-intro" name="_getIntroducedLink"> Get introduced </a>
</li>
<li>
<a href="/forwardProfileMsg?displayCreate=&profileID=82828415&profileName=Phillip+E%2E+G%2E&network=I&authToken=uja0&authType=OUT_OF_NETWORK&trk=pp_share_profile_action" class="external-link trk-share-profile" name="_shareProfileLink"> Share Profile </a>
</li>
<li class="one-click">
<a href="#" class="trk-find-references" name="vcard-9">Find references</a>
</li>
</ul>
</div>
</div>
<a href="/profile/view?id=82828415&authType=OUT_OF_NETWORK&authToken=uja0&locale=en_US&srchid=26e4d6f3-1ee3-436f-b006-395fded1f576-0&srchindex=10&srchtotal=1317249&goback=%2Efps_PBCK_instructor_*1_*1_*1_*1_*1_*1_*2_*1_Y_*1_*1_*1_false_1_R_*1_*51_*1_*51_true_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2&pvs=ps&trk=pp_profile_photo_link" class="profile-photo external-link trk-profile-photo" target="_top" tracking="hb_upphoto" data-li-larger-profile="http://media03.linkedin.com/media/p/2/000/068/3b8/1a0b9bf.jpg">
<img src="http://media02.linkedin.com/mpr/mpr/shrink_60_60/p/2/000/068/3b8/1a0b9bf.jpg" class="photo" alt="Phillip E. G." width="60" height="60">
<span class="larger-profile-photo-control"></span>
</a>
<h2>
<a href="/profile/view?id=82828415&authType=OUT_OF_NETWORK&authToken=uja0&locale=en_US&srchid=26e4d6f3-1ee3-436f-b006-395fded1f576-0&srchindex=10&srchtotal=1317249&goback=%2Efps_PBCK_instructor_*1_*1_*1_*1_*1_*1_*2_*1_Y_*1_*1_*1_false_1_R_*1_*51_*1_*51_true_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2&pvs=ps&trk=pp_profile_name_link" class="fn n external-link trk-profile-name" title="View Profile" target="_top">
Phillip E. G.
</a>
<span class="badges">
<abbr title="Phillip E. G. is a 3rd degree contact"><span class="network-degree">3<sup>rd</sup></span></abbr>
</span>
<span class="saved-profile">
<a href="/organizer?trk=subpro_goto_srch" >Saved</a>
</span>
</h2>
<a href="/profile/view?id=82828415&authType=OUT_OF_NETWORK&authToken=uja0&locale=en_US&srchid=26e4d6f3-1ee3-436f-b006-395fded1f576-0&srchindex=10&srchtotal=1317249&goback=%2Efps_PBCK_instructor_*1_*1_*1_*1_*1_*1_*2_*1_Y_*1_*1_*1_false_1_R_*1_*51_*1_*51_true_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2_*2&pvs=ps" class="url">View Profile</a>
<dl class="vcard-basic">
<dt>Title</dt>
<dd class="title">Director of Training - Clark County Dive Rescue Team</dd>
<dt class="demographic-info">Demographic info</dt>
<dd class="location-industry">
<span class="location">
Portland, Oregon Area
</span>
<span class="separator">·</span>
<span class="industry">
Public Safety
</span>
</dd>
<dt class="network-information">Network Information</dt>
<dd class="connections-recommendations">
500+ connections
<span class="separator">·</span>
1 recommendation
</dd>
</dl>
<dl class="vcard-expanded">
<dt class="current">Current:</dt>
<dd class="show-less-text">