Scrapy stucked in 400 error when scraping https://www.watsons.com.sg/
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}
I am trying to scrape this webpage: "https://www.watsons.com.sg/" but scrapy always result in 400 error. Attached the scrapy run log as reference here:
['diffmarts.pipelines.DiffmartsPipeline']
2019-01-01 21:17:14 [scrapy.core.engine] INFO: Spider opened
2019-01-01 21:17:14 [scrapy.extensions.logstats] INFO: Crawled 0 pages (at 0 pages/min), scraped 0 items (at 0 items/min)
2019-01-01 21:17:15 [scrapy.spidermiddlewares.httperror] INFO: Ignoring response <400 https://queue.watsons.com.sg/?c=aswatson&e=watsonprdsg&ver=v3-java-3.5.2&cver=62&cid=zh-CN&l=PoC+Layout+SG&t=https%3A%2F%2Fwww.watsons.com.sg%2F>: HTTP status code is not handled or not allowed
2019-01-01 21:17:15 [scrapy.core.engine] INFO: Closing spider (finished)
2019-01-01 21:17:17 [scrapy.core.engine] ERROR: Scraper close failure
I have tried inspect source in chrome and post and the content can be retrieved back by simple "get". So there should be no protection on the web site. Wonder what is wrong. Appreciate if anyone can offer suggestions or helps. Thanks.
redirect get scrapy
add a comment |
I am trying to scrape this webpage: "https://www.watsons.com.sg/" but scrapy always result in 400 error. Attached the scrapy run log as reference here:
['diffmarts.pipelines.DiffmartsPipeline']
2019-01-01 21:17:14 [scrapy.core.engine] INFO: Spider opened
2019-01-01 21:17:14 [scrapy.extensions.logstats] INFO: Crawled 0 pages (at 0 pages/min), scraped 0 items (at 0 items/min)
2019-01-01 21:17:15 [scrapy.spidermiddlewares.httperror] INFO: Ignoring response <400 https://queue.watsons.com.sg/?c=aswatson&e=watsonprdsg&ver=v3-java-3.5.2&cver=62&cid=zh-CN&l=PoC+Layout+SG&t=https%3A%2F%2Fwww.watsons.com.sg%2F>: HTTP status code is not handled or not allowed
2019-01-01 21:17:15 [scrapy.core.engine] INFO: Closing spider (finished)
2019-01-01 21:17:17 [scrapy.core.engine] ERROR: Scraper close failure
I have tried inspect source in chrome and post and the content can be retrieved back by simple "get". So there should be no protection on the web site. Wonder what is wrong. Appreciate if anyone can offer suggestions or helps. Thanks.
redirect get scrapy
1
your crawler is getting blocked. You are most likely missing some headers or have user agent header identify you as a bot. Could you post your spider code andsettings.py
?
– Granitosaurus
Jan 4 at 8:55
VisitNetwork calls
There i found a callhttps://in.hotjar.com/api/v1/client/sites/277609/visit-data?sv=5
that might be helpful.
– ThunderMind
Jan 4 at 11:59
I finally realized that we need to hard code the redirected url as the start url. That way the missing "/" causing 400 error will not happen. Thanks for all the helps and comments
– Patrick Chan
Jan 5 at 10:37
add a comment |
I am trying to scrape this webpage: "https://www.watsons.com.sg/" but scrapy always result in 400 error. Attached the scrapy run log as reference here:
['diffmarts.pipelines.DiffmartsPipeline']
2019-01-01 21:17:14 [scrapy.core.engine] INFO: Spider opened
2019-01-01 21:17:14 [scrapy.extensions.logstats] INFO: Crawled 0 pages (at 0 pages/min), scraped 0 items (at 0 items/min)
2019-01-01 21:17:15 [scrapy.spidermiddlewares.httperror] INFO: Ignoring response <400 https://queue.watsons.com.sg/?c=aswatson&e=watsonprdsg&ver=v3-java-3.5.2&cver=62&cid=zh-CN&l=PoC+Layout+SG&t=https%3A%2F%2Fwww.watsons.com.sg%2F>: HTTP status code is not handled or not allowed
2019-01-01 21:17:15 [scrapy.core.engine] INFO: Closing spider (finished)
2019-01-01 21:17:17 [scrapy.core.engine] ERROR: Scraper close failure
I have tried inspect source in chrome and post and the content can be retrieved back by simple "get". So there should be no protection on the web site. Wonder what is wrong. Appreciate if anyone can offer suggestions or helps. Thanks.
redirect get scrapy
I am trying to scrape this webpage: "https://www.watsons.com.sg/" but scrapy always result in 400 error. Attached the scrapy run log as reference here:
['diffmarts.pipelines.DiffmartsPipeline']
2019-01-01 21:17:14 [scrapy.core.engine] INFO: Spider opened
2019-01-01 21:17:14 [scrapy.extensions.logstats] INFO: Crawled 0 pages (at 0 pages/min), scraped 0 items (at 0 items/min)
2019-01-01 21:17:15 [scrapy.spidermiddlewares.httperror] INFO: Ignoring response <400 https://queue.watsons.com.sg/?c=aswatson&e=watsonprdsg&ver=v3-java-3.5.2&cver=62&cid=zh-CN&l=PoC+Layout+SG&t=https%3A%2F%2Fwww.watsons.com.sg%2F>: HTTP status code is not handled or not allowed
2019-01-01 21:17:15 [scrapy.core.engine] INFO: Closing spider (finished)
2019-01-01 21:17:17 [scrapy.core.engine] ERROR: Scraper close failure
I have tried inspect source in chrome and post and the content can be retrieved back by simple "get". So there should be no protection on the web site. Wonder what is wrong. Appreciate if anyone can offer suggestions or helps. Thanks.
redirect get scrapy
redirect get scrapy
edited Jan 4 at 8:53
Granitosaurus
11.8k22445
11.8k22445
asked Jan 4 at 5:08
Patrick ChanPatrick Chan
111
111
1
your crawler is getting blocked. You are most likely missing some headers or have user agent header identify you as a bot. Could you post your spider code andsettings.py
?
– Granitosaurus
Jan 4 at 8:55
VisitNetwork calls
There i found a callhttps://in.hotjar.com/api/v1/client/sites/277609/visit-data?sv=5
that might be helpful.
– ThunderMind
Jan 4 at 11:59
I finally realized that we need to hard code the redirected url as the start url. That way the missing "/" causing 400 error will not happen. Thanks for all the helps and comments
– Patrick Chan
Jan 5 at 10:37
add a comment |
1
your crawler is getting blocked. You are most likely missing some headers or have user agent header identify you as a bot. Could you post your spider code andsettings.py
?
– Granitosaurus
Jan 4 at 8:55
VisitNetwork calls
There i found a callhttps://in.hotjar.com/api/v1/client/sites/277609/visit-data?sv=5
that might be helpful.
– ThunderMind
Jan 4 at 11:59
I finally realized that we need to hard code the redirected url as the start url. That way the missing "/" causing 400 error will not happen. Thanks for all the helps and comments
– Patrick Chan
Jan 5 at 10:37
1
1
your crawler is getting blocked. You are most likely missing some headers or have user agent header identify you as a bot. Could you post your spider code and
settings.py
?– Granitosaurus
Jan 4 at 8:55
your crawler is getting blocked. You are most likely missing some headers or have user agent header identify you as a bot. Could you post your spider code and
settings.py
?– Granitosaurus
Jan 4 at 8:55
Visit
Network calls
There i found a call https://in.hotjar.com/api/v1/client/sites/277609/visit-data?sv=5
that might be helpful.– ThunderMind
Jan 4 at 11:59
Visit
Network calls
There i found a call https://in.hotjar.com/api/v1/client/sites/277609/visit-data?sv=5
that might be helpful.– ThunderMind
Jan 4 at 11:59
I finally realized that we need to hard code the redirected url as the start url. That way the missing "/" causing 400 error will not happen. Thanks for all the helps and comments
– Patrick Chan
Jan 5 at 10:37
I finally realized that we need to hard code the redirected url as the start url. That way the missing "/" causing 400 error will not happen. Thanks for all the helps and comments
– Patrick Chan
Jan 5 at 10:37
add a comment |
1 Answer
1
active
oldest
votes
Allow redirection in your spider. website is being redirected to some page then from that page redirect back to the main page.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54033376%2fscrapy-stucked-in-400-error-when-scraping-https-www-watsons-com-sg%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Allow redirection in your spider. website is being redirected to some page then from that page redirect back to the main page.
add a comment |
Allow redirection in your spider. website is being redirected to some page then from that page redirect back to the main page.
add a comment |
Allow redirection in your spider. website is being redirected to some page then from that page redirect back to the main page.
Allow redirection in your spider. website is being redirected to some page then from that page redirect back to the main page.
answered Jan 6 at 17:07
ThunderMindThunderMind
639214
639214
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54033376%2fscrapy-stucked-in-400-error-when-scraping-https-www-watsons-com-sg%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
your crawler is getting blocked. You are most likely missing some headers or have user agent header identify you as a bot. Could you post your spider code and
settings.py
?– Granitosaurus
Jan 4 at 8:55
Visit
Network calls
There i found a callhttps://in.hotjar.com/api/v1/client/sites/277609/visit-data?sv=5
that might be helpful.– ThunderMind
Jan 4 at 11:59
I finally realized that we need to hard code the redirected url as the start url. That way the missing "/" causing 400 error will not happen. Thanks for all the helps and comments
– Patrick Chan
Jan 5 at 10:37