问题
I successfully ran the PhantomJS+Selenium in Python 3.5 in my laptop, but when I used it on AWS EC2 CentOS 6 environment, I did not get error but got the content showing:
<html><head><meta content="no-cache" http-equiv="Pragma">
<meta content="-1" http-equiv="Expires">
<meta content="no-cache" http-equiv="CacheControl">
<meta content="IE=edge" http-equiv="X-UA-Compatible">
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<link href="data:;base64,iVBORw0KGgo=" rel="shortcut icon">
<script>
(function(){
var securemsg;
var dosl7_common;
window["bobcmn"] = "11111011111010200000002200000005200000000224b7a934200000096300000000300000000300000006/TSPD/300000008TSPD_101300000004http200000000200000000";
Can someone help me to figure out what was the reason and possible solutions? Thank you so much!
回答1:
http://stackoverflow.com/questions/34707532/python-post-request-not-returning-html-requesting-javascript-be-enabled
Please take a look at Backgammon's answer, very good point, basically, you encountered bot-defeat system. headless browser like PhantomJS can be detected and against. I guess if it's debugging, you can use selenium & Chrome.
来源:https://stackoverflow.com/questions/43097937/phantomjs-get-no-real-content-running-on-aws-ec2-centos-6