我正在开发爬虫,我的任务是从网站获取产品图片。我尝试以无头模式(使用ChromePHP)和没有使用domcrawler的无头模式从该网站上抓取产品图片。
无论哪种方式,我都只会获得每个产品的通用 HTML 正文。我无法找到正确的 HTML 标签,因为下面是一个示例输出(这里是完整的回复)。这是否意味着网站使用某种脚本进行重定向?如果是这样,我怎样才能绕过它来完成这个?如果没有其他从本网站获取产品图片的替代方法?
"""
<html lang="en-us" class="tb225 tb225v1"><head>
\t<style>
.create-account__header-qDN .ap__subtitle-3OP ,
.create-account__header-qDN .ap__title-2Tg{
color: transparent;
font-size: 0;
letter-spacing: -1px;
}
.create-account__header-qDN .ap__title-2Tg:after,
.create-account__header-qDN .ap__subtitle-3OP:after {
color: #191919;
font-size: 16px;
}
.create-account__header-qDN .ap__title-2Tg:after {
content: 'TAKE 10% OFF YOUR FIRST ORDER OF $200+';
letter-spacing: 1.5px;}
.create-account__header-qDN .ap__subtitle-3OP:after {
content: 'Create an account and join our list to hear about exclusive offers, new collections and sale events. Exclusions apply.';
letter-spacing: 0;
}
</style>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0, shrink-to-fit=no">
<title>[Product Name]: Women's Designer [L2]</title>
<meta name="title" content="[Product Name]: Women's Designer [L2]">
<meta name="description" content="Shop [Brand] women's designer [L1] including the [Product Name]. Get free shipping & returns on designer shoes, handbags, ▶
<meta http-equiv="content-language" content="en-us">
<meta property="og:image" content="https://s7.toryburch.com/is/image/ToryBurch/medallion-navy@2x.1200x1200.jpg">
<meta property="og:image:width" content="1200">
<meta property="og:image:height" content="1200">
<meta property="og:site_name" content="Tory Burch">
<meta property="og:type" content="website">
<meta property="og:title" content="[Product Name]: Women's Designer [L2]">
<meta property="og:description" content="Shop [Brand] women's designer [L1] including the [Product Name]. Get free shipping & returns on designer shoes, han ▶
<meta property="og:url" content="https://www.toryburch.com/en-us/pdp/">
<meta property="og:price:amount" content="">
<meta property="og:price:currency" content="">
<meta name="twitter:site" content="@toryburch">
<meta name="twitter:url" content="https://www.toryburch.com/en-us/pdp/">
<meta name="twitter:image" content="https://s7.toryburch.com/is/image/ToryBurch/medallion-navy@2x.1200x1200.jpg">
<meta name="twitter:title" content="[Product Name]: Women's Designer [L2]">
<meta name="twitter:description" content="Shop [Brand] women's designer [L1] including the [Product Name]. Get free shipping & returns on designer shoes, ha ▶
<meta name="twitter:card" content="summary">
<meta name="twitter:label1" content="null">
<meta name="twitter:data1" content="null">
<meta name="twitter:label2" content="null">
<meta name="twitter:data2" content="null">
<meta name="fragment" content="!">
<meta name="facebook-domain-verification" content="fvtzlntz7y279jttjaojjv0cihao7t">
<link rel="canonical" href="https://www.toryburch.com/en-us/pdp/">
<link rel="preconnect" href="https://s.toryburch.com">
<link rel="preconnect" href="https://s7.toryburch.com">
<link rel="dns-prefetch" href="https://cdn.optimizely.com">
<link rel="dns-prefetch" href="https://use.typekit.net">
<link rel="dns-prefetch" href="https://p.typekit.net">
<link rel="dns-prefetch" href="https://www.googletagmanager.com">
<link rel="dns-prefetch" href="https://cdn.cookielaw.org">
<script async="" src="https://cdn.gladly.com/chat-sdk/widget.js?q=1636628485901"></script><script type="text/javascript" id="ftr__script" async="" src="http ▶
window.__INITIAL_STATE__ = {
aem: {
wcmMode: 'disabled',
isAuthor: false,
imagePlaceholderColor: ''
},
afterpay: {
scriptUrl: 'https://js.afterpay.com/afterpay-1.x.js',
minAmountUSD: 35,
maxAmountUSD: 2000,
enabled: true
},
i18n: {
locale: 'en_US',
version: '82cdbc803b6dc44e70fbc2d23addbe09',
siteCountry: 'US',
siteLanguage: 'EN',
currencySymbol: '$'
},
features: {
hasTorysportBrand: true,
displayFindInStore: function (ctx) {
return (ctx.product.brand) === ("Tory Burch");
},
displayMobileSwatches: function (ctx) {
return (ctx.product.productDepartmentId) === ("handbags");
},
getSizeGuidePath: function (ctx) {
if ((ctx.product.brand) === ("Tory Sport")) { if (ctx.product.productDepartmentId && ctx.product.productDepartmentId.startsWith("clothing")) { r ▶
if (ctx.product.productDepartmentId && ctx.product.productDepartmentId.startsWith("shoes")) { return "ts-sizechart-shoes"; } }
if ((ctx.product.brand) === ("Tory Burch")) { if (ctx.product.productDepartmentId && ctx.product.productDepartmentId.startsWith("clothing")) { return "tb-sizech ▶
if (ctx.product.productDepartmentId && ctx.product.productDepartmentId.startsWith("swim")) { return "tb-sizechart-swim"; }
if (ctx.product.productDepartmentId && ctx.product.productDepartmentId.startsWith("shoes")) { return "tb-sizechart-shoes"; }
if ((ctx.product.productDepartmentId && ctx.product.productDepartmentId.startsWith("accessories")) && (ctx.product.productClassId && ctx.product.productClassId. ▶
if ((ctx.product.productDepartmentId && ctx.product.productDepartmentId.startsWith("jewelry")) && (ctx.product.productClassId && ctx.product.productClassId.star ▶
},
displayInGridSizeFilter: function (ctx) {
return ['shoes-newarrivals', 'shoes-view-all', 'shoes-boots-booties', 'shoes-sneakers', 'shoes-sandals', 'shoes-mules-loafers', 'shoes-ballet', ▶
},
showExclusivesDot: function (ctx) {
return ctx.promotionsId.some((e) => [].includes(e));
},
vatLabel: '',
discountBadgeLabel: 'less than comp value',
discountBadgeEnabled: false,
shouldRecalculateCartOnInit: true,
shouldRefreshJwt: true,
enabledBrandAgnosticSearch: false,
enabledOneTrust: true,
newCreateAccountPopupEnabled: false,
accountEmailPreferencesEnabled: true,
giftCardPaymentEnabled: true,
cartPromoEnabled: true,
cartYAMLEnabled: true,
donationWidgetEnabled: false,
orderSignInEnabled: true,
subscribeCheckboxEnabled: true,
enabledAddressValidation: true,
enabledPayPal: true,
fullWidthEnabled: true,
stickySearchEnabled: false,
isOutlet: false,
restrictedAccessEnabled: false,
newBundlesEnabled: true,
sppTabsEnabled: false,
favoritesEnabled: true,
ymalEnabled: true,
preCheckConsentCheckboxes: true,
surveyEnabled: true,
filtersEnabled: true,
newBadgesEnabled: true,
urlConsolidationEnabled: true, // TODO remove after frontend toggle is gone
srpFiltersEnabled: true,
inGridSizeFilterEnabled: false,
exposedCategoryFiltersEnabled: true,
sportFilterEnabled: false,
checkoutSignInEnabled: true,
cartRestorationFromUrl: false,
shipmentCountryDropdownEnabled: true,
headerLeftEnabled: true,
headerRightEnabled: true,
cartPayByLinkErrorEnabled: false,
newTaxonomyAnalyticsEnabled : true,
facetedNavigationEnabled: true,
gxPromoBadgesEnabled: true,
invoicePaymentEnabled: false,
idmEnabled: false,
miniBagRecommendationsEnabled: false,
heroEnabled: false
},
urls: {
accountPage: '/en-us/account/',
accountOverviewPage: '/en-us/account/overview/',
accountOrdersPage: '/en-us/account/orders/',
accountPublicOrderDetailsPage: '/en-us/order-details/',
accountPrivateOrderDetailsPage: '/en-us/account/orders/order-details/',
accountFavoritesPage: '/en-us/account/favorites/',
accountExclusivesPage: '/en-us/user/account/exclusives/',
accountSettingsPage: '/en-us/account/settings/',
accountUnsubscribePage: '/en-us/unsubscribe/',
resetPasswordPage: '/en-us/reset-password/',
rootPage: '/en-us/',
error404Page: '/en-us/error-pages/404/',
cartPage: '/en-us/cart/',
productDetailsPage: '/en-us/pdp/',
checkoutPage: '/en-us/checkout/',
homePage: '/en-us/',
sportHomePage: '/en-us/sport/',
searchResultsPage: '/en-us/search/',
clientServicesPage: '/en-us/client-services/',
privateSalePage: '/en-us/sale/view-all/',
favoritesPage: '',
sharedFavoritesPage: '/en-us/favorites/',
emailUsPage: '/en-us/client-services/contact-us/',
privacyPolicyPage: '/en-us/content-privacy/content-privacy/',
orderConfirmationPage: '/en-us/order-confirmation/',
shippingConfirmationPage: '/en-us/shipping-confirmation/',
fossilWatchWarrantyPage: '/en-us/client-services/product-information/watch-instructions-warranty/',
pdpPrefix: '/en-us',
sizeGuidesPrefix: '/en-us/size-guides/',
storeLocatorPage: '/en-us/store-locator/',
allStoresPage: '/en-us/store-locator/all-stores/',
fullPriceStorePage: '/en-us/store-locator/full-price/',
outletStorePage: '/en-us/store-locator/outlet/',
trackOrderPage: '',
invitationLandingPage: '',
payByLink: 'https://checkout.toryburch.com/en-us/checkout/'
},
configurations: {
apiKey: 'yP6bAmceig0QmrXzGfx3IG867h5jKkAs',
apiHost: 'https://www.toryburch.com/api/prod-r2',
siteKey: 'ToryBurch_US',
staticHost: 'https://s.toryburch.com',
trackOrderEndpoint: 'https://www.toryburch.com/on/demandware.store/Sites-ToryBurch_US-Site/default/Order-Track',
googleApiKey: 'AIzaSyAXINoz8O-SMRVka0O-UaAmJj3rJm8ylz4',
recaptchaSiteKey: '6LdtQaUUAAAAAK9O6sREG1xyD6I8KxGNp4G6vdlL',
},
shipping: {
defaultShippingDestination: 'US'
},
gladly: {
enabled: true,
appId: 'e3d03368\u002Da188\u002D11e8\u002Da536\u002D73471cd22e7b',
layerAppEnv: '',
cdn: 'https:\/\/cdn.gladly.com',
scriptUrl: 'https:\/\/cdn.gladly.com\/chat\u002Dsdk\/widget.js'
},
gmo: {
scriptUrl: 'https://static.mul-pay.jp/ext/js/token.js',
shopId: '9000558218684'
},
bazaarVoice: {
enabled: true,
scriptUrl: 'https://toryburch.ugc.bazaarvoice.com/static/3533-en_us/bvapi.js',
rootUrl: 'https://www.toryburch.com/',
displayKey: '3533-en_us',
},
adyen: {
scriptUrl: 'https://live.adyen.com/hpp/cse/js/1115398733511058.shtml',
checkoutScriptUrl: 'https://checkoutshopper-live.adyen.com/checkoutshopper/sdk/3.4.0/adyen.js',
checkoutStyleUrl: 'https://checkoutshopper-live.adyen.com/checkoutshopper/sdk/3.4.0/adyen.css',
originKey: 'pub.v2.8215109219572223.aHR0cDovL2xvY2FsaG9zdDo0NTAy.T0gTQcrWOQsODu3xUw6f6i8oSUb_9Y8mxK1m45mKIr4',
locale: 'en-US',
environment: 'live'
},
s7config: {
account: 'ToryBurch',
cleanURL: true,
origin: 'https://s7.toryburch.com',
altAccount: 'ToryBurch',
productImageAccount: 'ToryBurch',
productOrigin: 'https://s7.toryburch.com',
productVideoAccount: 'ToryBurchLLC',
productDirectOrigin: 'https://s7d2.scene7.com',
},
assets: {
heartIconUri: 'gold-heart-v2'
},
applePay: {
enabled: true,
applePayValidateUrl: '/on/demandware.store/Sites-ToryBurch_US-Site/default/__SYSTEM__ApplePay-ValidateMerchant',
applePayMerchantIdentifier: 'merchant.com.applepay.toryburch.adyen'
},
sentry: {
enabled: true,
dsn: 'https://65f80d4eb29a4c3e8ef15210a4a85796@sentry.io/1811378',
environment: 'production'
},
shopRunner: {
enabled: true,
shopRunnerRetailerID: 'TORYBURCH',
shopRunnerEnvironmentID: 2,
shopRunnerImgPathURL: 'https://content.shoprunner.com/assets/pik/',
shopRunnerStaticJs: 'https://content.shoprunner.com/TORYBURCH.js',
shopRunnerStaticCss: 'https://content.shoprunner.com/SecureTORYBURCH.css',
shopRunnerPartnerContentURL: 'https://content.shoprunner.com/',
shopRunnerJsContentURL: 'https://content.shoprunner.com',
shopRunnerEnvPROD: 2
},
einstein: {
einsteinRecommendationsEnabled: true,
einsteinTrackingEnabled: true,
einsteinRealm: 'aafh',
einsteinEndpointUrl: 'https://api.cquotient.com/v3/activities',
einsteinCqClientId: '61ae057e-d281-4de0-9eef-4de98ac12e72',
sendDataToEinstein: true
},
cart: JSON.parse('{\x22addToBagAnimation\x22:{\x22mainline\x22:{\x22asset\x22:{\x22hotspots\x22:[],\x22format\x22:\x22gif\x22,\x22ratio\x22:\x22200\/267 ▶
search: {
enabled: true,
desktopRowsNumber: 3
},
klarna : {
enabled: false,
servicesScriptUrl: '',
clientId: '',
messagingEnabled: false
},
hero : {
appId: '687652a2-80e3-40d6-b45a-fef6c0b3b2e6',
isSendDataEnabled: true
},
recommenders : {
cartRecommenderName: 'Cart-PeopleBoughtAlsoBought',
pdpRecommenderName: 'PDP-product-to-product'
},
popups: JSON.parse('{\x22navigationPopupPath\x22:\x22\/en\u002Dus\/overlays\/popups\/navigation\u002Dpopup\/\x22,\x22emailSignUpPopupDelay\x22:28,\x22em ▶
banners: JSON.parse('{}'),
json: JSON.parse('{\x22title\x22:\x22Product Details Page\x22,\x22pageTitle\x22:\x22Product Details Page\x22,\x22subtitle\x22:\x22Product Details Page\x ▶
};
</script>
<!-- OneTrust Cookies Consent Notice start -->
<script src="https://cdn.cookielaw.org/scripttemplates/otSDKStub.js" data-domain-script="31f0e11c-a741-46cc-9637-9fc3160b711c" data-document-language="true" ▶
<script>
function OptanonWrapper() {
window['gtmDataLayer'] = window['gtmDataLayer'] || [];
window.gtmDataLayer.push({
'event': 'e_oneTrustConsentChanged'
});
}
</script>
<!-- OneTrust Cookies Consent Notice end -->
<link rel="preload" as="script" href="https://www.toryburch.com/resources/7d18ec7a4196c23824e835eb4499d7ea0b11548404270"><link rel="preload" href="https://s ▶
<style id="tb-critical-path">@font-face{font-display:swap;font-family:GothicStd;font-weight:500;src:local("ITC Avant Garde Gothic Std Medium"),url("https://s.to ▶
<script>!function(e){var t={};function n(o){if(t[o])return t[o].exports;var i=t[o]={i:o,l:!1,exports:{}};return e[o].call(i.exports,i,i.exports,n),i.l=!0,i.expo ▶
<link rel="icon" type="image/png" sizes="16x16" href="https://s.toryburch.com/etc.clientlibs/ui/react/resources/favicons/icon_16x16.png">
<link rel="icon" type="image/png" sizes="32x32" href="https://s.toryburch.com/etc.clientlibs/ui/react/resources/favicons/icon_32x32.png">
<link rel="icon" type="image/png" sizes="96x96" href="https://s.toryburch.com/etc.clientlibs/ui/react/resources/favicons/icon_96x96.png">
<link rel="icon" type="image/png" sizes="192x192" href="https://s.toryburch.com/etc.clientlibs/ui/react/resources/favicons/icon_192x192.png">
<link rel="apple-touch-icon" href="https://s.toryburch.com/etc.clientlibs/ui/react/resources/favicons/apple/icon_120x120.png">
<link rel="apple-touch-icon" sizes="180x180" href="https://s.toryburch.com/etc.clientlibs/ui/react/resources/favicons/apple/icon_180x180.png">
<link rel="apple-touch-icon" sizes="167x167" href="https://s.toryburch.com/etc.clientlibs/ui/react/resources/favicons/apple/icon_167x167.png">
<link rel="apple-touch-icon" sizes="152x152" href="https://s.toryburch.com/etc.clientlibs/ui/react/resources/favicons/apple/icon_152x152.png">
<link rel="mask-icon" href="https://s.toryburch.com/etc.clientlibs/ui/react/resources/pinned-tab/safari-pinned-tab.svg" color="#0c2340">
<link rel="manifest" href="/etc/clientlibs/toryburch/resources/manifest.json">
<meta name="msapplication-TileColor" content="#ffffff">
<meta name="theme-color" content="#ffffff">
<link rel="preload" as="style" href="https://s.toryburch.com/etc.clientlibs/ui/react/resources/publisher.dbf5ebc065b05233f1be.tb-suffix.css">
<link id="tb-main-css" rel="stylesheet" href="https://s.toryburch.com/etc.clientlibs/ui/react/resources/publisher.dbf5ebc065b05233f1be.tb-suffix.css">
<script type="module">
var link = document.getElementById('tb-main-css');
link.rel = 'stylesheet';
link.href = 'https://s.toryburch.com/etc.clientlibs/ui/react/resources/publisher.dbf5ebc065b05233f1be.tb-suffix.css';
link.onload = () => {window.isMainStyleLoaded = true};
</script>
<link rel="stylesheet" href="https://use.typekit.net/jak7ioq.css">
<script src="https://cdn.optimizely.com/js/14720940047.js"></script><script async="" src="https://static.hotjar.com/c/hotjar-465730.js?sv=6"></script>
<!--Google Tag Manager -->
<script>
(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],j=d.createElement(s),dl=l!='d ▶
</script>
<!--End Google Tag Manager -->
<meta name="google-site-verification" content="o1UHxuzx6PXPqV-iLXZ8aByfraZSVrz88GDGS4n5x40">
<script src="https://geolocation.onetrust.com/cookieconsentpub/v1/geo/location" async="" type="text/javascript"></script><style id="kvuucddy"></style><style id= ▶
#footer-wrapper > *:not(#foundation-banner):not(#sign-up-footer) {
position: relative;
transform: translate3d(0,0,0);
z-index: 2;
}
</style><script async="" src="https://script.hotjar.com/modules.dad547d55d09325865c9.js" charset="utf-8"></script><style type="text/css">iframe#_hjRemoteVarsF ▶
<body class="outline-none">
<!--Google Tag Manager (noscript) -->
<noscript>
<iframe src='https://www.googletagmanager.com/ns.html?id=GTM-WFQWPS9' height='0' width='0' style='display:none;visibility:hidden'></iframe>
</noscript>
<!-- End Google Tag Manager (noscript) -->
<div id="root" aria-hidden="false"><div><header id="layout-header" class="header-3Go"><div class="above-nav-1wb"></div><div class="header-_nq" data-id="tory ▶
<p style="font-size: 16px; line-height: 21px; letter-spacing: 0px;"><span class="rte-font--caslon rte-color--tory-black">Create an account and join our list to ▶
</div><div class="banner__cta-3su" style="margin-top: 20px;"><button title="SIGN UP" type="button" class="button-link-3EB button-link--large-Vdr button-link--tb ▶
<svg style="display: none;"><use xlink:href="/assets/sprite.2dbfa8.svg#"></use></svg>
<script type="module" src="https://s.toryburch.com/etc.clientlibs/ui/react/resources/runtimechunk~publisher.59475dd88ee7493dce4b.js"></script>
<script type="module" src="https://s.toryburch.com/etc.clientlibs/ui/react/resources/vendors.90810ea7f820f9f2501c.js"></script>
<script type="module" src="https://s.toryburch.com/etc.clientlibs/ui/react/resources/publisher.06512d5571b906090034.js"></script>
<script nomodule="">
var link = document.createElement('link');
link.rel = 'stylesheet';
link.href = 'https://s.toryburch.com/etc.clientlibs/ui/react/resources/legacy.22ebcf2a79be2cc66cb7.tb-suffix.css';
document.head.appendChild(link);
var script = document.createElement('script');
script.src = 'https://s.toryburch.com/etc.clientlibs/ui/react/resources/legacy.92d023b17df2823612a0.js';
document.head.appendChild(script);
</script>
<!--Forter -->
<script>
(function() {
function t(t,e){for(var n=t.split(""),r=0;r<n.length;++r)n[r]=String.fromCharCode(n[r].charCodeAt(0)+e);return n.join("")}function e(e){return t(e,-h).r ▶
})()
</script>
<!--End of Forter -->
<script type="application/ld+json">
{
"@context" : "http://schema.org",
"@type" : "WebSite",
"name" : "Tory Burch",
"url" : "https://www.toryburch.com/en-us/"
}
</script>
<script type="application/ld+json">
{
"@context" : "http://schema.org",
"@type" : "Organization",
"legalName" : "Tory Burch",
"url" : "https://www.toryburch.com/en-us/",
"contactPoint" : [
{
"telephone" : "+1-866-480-8679",
"contactType" : "customer service",
"type" : "ContactPoint"
}
],
"logo" : "https://s.toryburch.com/etc.clientlibs/ui/react/resources/pinned-tab/safari-pinned-tab.svg",
"sameAs" : [
"https://www.facebook.com/toryburch/"
,
"https://twitter.com/toryburch"
,
"https://instagram.com/toryburch"
,
"https://pinterest.com/ToryBurch/"
,
"https://toryburch.tumblr.com/"
,
"https://www.youtube.com/toryburch/"
,
"https://www.linkedin.com/company/tory-burch/"
]
}
</script>
<iframe name="_hjRemoteVarsFrame" title="_hjRemoteVarsFrame" id="_hjRemoteVarsFrame" src="https://vars.hotjar.com/box-028f986f575e1b13474634857daa6bfc.html" sty ▶
this.c=[];this.e=t(this);p(this,a,!c);var d=a.push,e=this;a.push=function(){var b=[].slice.call(arguments,0),c=d.apply(a,b);p(e,b);return c}}function p(a,b,c){f ▶
b[h]),a.a);else continue;c||(a.d=!0,a.f(a.a,b),a.d=!1)}}function t(a){return{set:function(b,c){l(q(b,c),a.a)},get:function(b){return a.get(b)}}}function q(a,b){ ▶
function(a){var b=this.a;a=a.split(".");for(var c=0;c<a.length;c++){if(void 0===b[a[c]])return;b=b[a[c]]}return b};h.prototype.flatten=function(){this.b.splice( ▶
<script type="text/javascript" id="">(function(){var d=function(a,b){try{switch(b.event){case "e_vpv":setTimeout(function(){gtmDataLayer.push({event:"e_vpv_dela ▶
c.message)}},!0),document.addEventListener("timeupdate",function(b){try{var a=b.target;e(a);var c=b.target.duration,g=b.target.currentTime,d=1.5>=c-g?1:(Math.fl ▶
"""