Tag : python

Learn about Golang’s market situation Project address:https://github.com/go-crawler … If it is helpful to you, welcome Star and give the article a praise so that more people can see it:) Target Golang is already a part of the work. I want everyone to know about the market situation of Golang, and I also want more people ..

Read more

Fake-useragent of Go Some websites will jump to different (PC, M) websites according to the different User-Agent, and will give different prompts according to different versions, etc. The change of User-Agent is the basic posture in the crawler. If you use Go to write a web crawler or need to simulate a User-Agent, will it ..

Read more

About elastalert Elastalert is an elasticsearch-based alert service produced by yelp and written in python. The overall idea is still based on polling method. If rules are applied, frequency, spike, flatline, blacklist/whitelist, any and change are built in. In case of alarm, Email, HipChat, Slack, Telegram, etc. are provided. dockerfile # Elastalert Docker image running ..

Read more

example #coding=UTF-8 import sys import MySQLdb import time reload(sys) sys.setdefaultencoding(‘utf-8’) def connectDemo(): return MySQLdb.Connection(“127.0.0.1″,”root”,”root”,”demo”,3306,charset=”utf8″) if __name__ == ‘__main__’: begin=time.time() conn=connectDemo() cursor = conn.cursor() sql=””” show tables “”” count = cursor.execute(sql) rows = cursor.fetchall() cursor.close() conn.close() print “========demo库共:%s 张表============” % (count) print ‘耗时:%s 秒’ % (time.tim..

Read more

I accidentally saw a headline algorithm question on the pulse According to the understanding of the topic, I simply wrote an html webpage <! DOCTYPE html> <html> <head> <meta charset=”utf-8″> <meta http-equiv=”X-UA-Compatible” content=”IE=edge”> <title>pool</title> <meta name=”viewport” content=”width=device-width, initial-scale=1″> </head> <body> <div id=”vue_det”> <div @click=”SmartChange(0)” style=”width:40px; height:40px; Background:#fff “> start < /div > <div class=”pool” v-for=”(item, ..

Read more

The front-end encapsulates the FormData object post to the back-end nodejs. nodejs uses formidable to parse the request. Up to this point, there has been no problem. nodejs can successfully parse the request and print out the desired data. However, I wanted to send the data obtained after parsing the request to the python server ..

Read more

var SomeModel = Backbone.Model.extend({ validation: { email: { required: true, pattern: ’email’, msg: ‘Please enter a valid email’ bracket }, validate: function(attr){ console.log(attr); bracket }); var some = new SomeModel(); some.set(’email’, ‘test’, {validate: true}); console.log(some); Can you help me write an example? I wrote a test according to the instructions. I don’t know how to ..

Read more

The first way is to store custom events directly in __onfireEvents var __onfireEvents = {}; function _bind(eventName, callback, is_one, context) { if (typeof eventName ! == string_str || typeof callback ! == function_str) { Throw new Error(‘args:’ plus string_str plus’,’ plus function_str plus’); bracket if (! hasOwnKey(__onfireEvents, eventName)) { __onfireEvents[eventName] = {}; bracket __onfireEvents[eventName][ plus ..

Read more

My thinking is <vedio src=’/xx/api’> The back end transmits video file data (binary) to the front end, and then changes the corresponding header.However, I did not succeed in my attempt, and I did not find any relevant information on the Internet.I don’t know what the problem is. Perhaps the desired effect is this http://hc.yinyuetai.com/uploads/videos/common/B7D20154766D39739AF193BCE138419F.flv? sc\u003d0743670c523be875\u0026br\u003d759\u0026vid\u003d2561631\u0026aid\u003d311\u0026area\u003dHT\u0026vst\u003d2 ..

Read more