2021年6月23日 星期三

How to Automate Login using Selenium and how to Extract and Submit Web Forms from a URL using Python

 https://www.thepythoncode.com/article/automate-login-to-websites-using-selenium-in-python

https://www.thepythoncode.com/article/extracting-and-submitting-web-page-forms-in-python





How to Automate Login using Selenium in Python

Learn how to use Selenium library with Chrome driver in Python to login to websites automatically as well as verifying login success.



Controlling a web browser from a program can be useful in many scenarios, example use cases are website text automation and web scraping, a very popular framework for this kind of automation is Selenium WebDriver.

Selenium WebDriver is a browser-controlling library, it supports all major browsers (Firefox, Edge, Chrome, Safari, Opera, etc.) and is available for different programming languages including Python. In this tutorial, we will be using its Python bindings to automate login to websites.

Automating the login process to a website proves to be handy. For example, you may want to edit your account settings automatically, or you want to extract some information that requires login, etc.

We have a tutorial on extracting web forms using BeautifulSoup library, so you may want to combine extracting login forms and filling them with the help of this tutorial.

First, let's install Selenium for Python:

pip3 install selenium

The next step is installing the driver specific to the browser we want to control, download links are available on this page. I'm installing ChromeDriver, but you're free to use your favorite.

To make things concrete, I'll be using Github login page to demonstrate on how you can automatically login using Selenium.

Open up a new Python script and initialize the WebDriver:

from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait

# Github credentials
username = "username"
password = "password"

# initialize the Chrome driver
driver = webdriver.Chrome("chromedriver")

After you downloaded and unzipped the driver for your OS, put it in your current directory or in a known path, so you can pass it to webdriver.Chrome() class. In my case, chromedriver.exe is in the current directory, so I simply pass its name to the constructor.

Since we're interested in automating Github login, we'll navigate to Github login page and we inspect the page to identify its HTML elements:

Github Login page HTML elementsThe id of the login and password input fields, and the name of the Sign in button will be useful for us to retrieve these elements in code and insert to it programmatically.

Notice the username/email address input field has login_field id, where the password input field has the id of password, see also the submit button has the name of commit, the below code goes to Github login page, extracts these elements, fills the credentials and clicks the button:

# head to github login page
driver.get("https://github.com/login")
# find username/email field and send the username itself to the input field
driver.find_element_by_id("login_field").send_keys(username)
# find password input field and insert password as well
driver.find_element_by_id("password").send_keys(password)
# click login button
driver.find_element_by_name("commit").click()

The find_element_by_id() function retrieves an HTML element by its id, and the send_keys() method simulates keypresses, the above code cell will make Chrome type in the email and the password, and then click the Sign in button.

The next thing to do is to determine whether our login was successful, there are a lot of ways to detect that, but in this tutorial, we'll do it by detecting the shown errors upon login (of course, this will change from a website to another).

Github Error Login PageThe above image shows what happens when we insert wrong credentials, you'll see a new HTML div element with the class "flash-error" that has the text of "Incorrect username or password.".

The below code is responsible for waiting for the page to be loaded after the login is performed using WebDriverWait(), and checks for the error:

# wait the ready state to be complete
WebDriverWait(driver=driver, timeout=10).until(
    lambda x: x.execute_script("return document.readyState === 'complete'")
)
error_message = "Incorrect username or password."
# get the errors (if there are)
errors = driver.find_elements_by_class_name("flash-error")
# print the errors optionally
# for e in errors:
#     print(e.text)
# if we find that error message within errors, then login is failed
if any(error_message in e.text for e in errors):
    print("[!] Login failed")
else:
    print("[+] Login successful")

We use WebDriverWait to wait until the document finished loading, the execute_script() method executes Javascript in the context of the browser, the JS code return document.readyState === 'complete' returns True when the page is loaded, and False otherwise.

Finally, we close our driver:

# close the driver
driver.close()

Conclusion

Alright, now you have the skill to login automatically to the website of your choice, note that Github will block you when you run the script multiple times with wrong credentials, so be aware of that.

Now you can do the thing you want to do after you login using your account, you can add the code in the line where we're printing 'Login successful'.

Also, if you've successfully logged in using your real account, you may encounter email confirmation, to bypass that, you have to read your email programmatically with Python and extracts the confirmation code and insert it in real time using Selenium, great challenge, isn't it ? Good luck on it!

Note that login process will differ from website to another, the goal of this tutorial is to give you the essential skills to automate the login of your target website.




End

2020年9月16日 星期三

vue create Vue3 on 2020 September + Typescript

Vue 3

woirking on C:\d\lab\flaskw3html\19.vuejs\06.app

reference https://www.jianshu.com/p/e817141b1c8d


vue create vue3

Manual (not vue 2 default or vue 3 default)

On top of default Babel and Linter Formatter, add Router and Vuex

3.x (Preview) not 2.x

History mode n

linter choose Prettier (not error prevention only nor Airbnb nor Standard)

Lint on save (not fix on commit)

dedicated config files (not package.json)


顺便安装bootstra-vue

npm install bootstrap bootstrap-vue


now we can

cd vue3

npm run serve


Optionally modify package.json to add --port 8090 so that

"serve": "vue-cli-service serve -- port 8090",

beside package.json, create "npm.run.serve.bat"

start http://localhost:8090

npm run serve





main.js

import { createApp, Vue } from "vue";

import { BootstrapVue, IconsPlugin } from "bootstrap-vue";

Vue.use(BootstrapVue);

Vue.use(IconsPlugin);

import "bootstrap/dist/css/bootstrap.css";

import "bootstrap-vue/dist/bootstrap-vue.css";


https://stackoverflow.com/questions/63570340/how-to-use-vue-3-add-plugin-boostrap-vue

Bootstrap vue does not support Vue 3 on 2020 September yet


Conclusion:

Only Bootstrap-Vue does not work with Vue3. Others work include:

.env.development
import axios from "axios";
fetch("https://api.coindesk.com/v1/bpi/currentprice.json")
import _ from "lodash";
import Papa from "papaparse";
<script scoped>
import VuexPersist from "vuex-persist";
plugins: [vuexLocal.plugin]


Vuex is 99% the same except

import Vuex from "vuex";
Vue.use(Vuex);
export default new Vuex.Store()

becomes

import { createStore } from "vuex";
export default createStore()



How about Typescript?

vue create vue3

keep default Babel, select TypeScript VueX Router

3.x

No for class-style component syntax

Yes for Babel alongside TypeScript

No for router history mode


最重要的axios原本封装之后不知道如何import去另外一个VueX的index.ts!不能使用



asdsad


End

2020年9月15日 星期二

NodeJS ExpressJS Request Content from Axios

I have a VueJS 2 axios api call

axios.post("login", { username: this.username, password: this.password });


The NodeJS ExpressJS code is

app.post('/login', function (req, res) {

    console.log('req', req);

});


On the console


req IncomingMessage {

  _readableState: ReadableState {

    objectMode: false,

    highWaterMark: 16384,

    buffer: BufferList { head: null, tail: null, length: 0 },

    length: 0,

    pipes: null,

    pipesCount: 0,

    flowing: true,

    ended: true,

    endEmitted: true,

    reading: false,

    sync: false,

    needReadable: false,

    emittedReadable: false,

    readableListening: false,

    resumeScheduled: false,

    paused: false,

    emitClose: true,

    autoDestroy: false,

    destroyed: false,

    defaultEncoding: 'utf8',

    awaitDrain: 0,

    readingMore: false,

    decoder: null,

    encoding: null

  },

  readable: false,

  _events: [Object: null prototype] {

    end: [Function: resetHeadersTimeoutOnReqEnd]

  },

  _eventsCount: 1,

  _maxListeners: undefined,

  socket: Socket {

    connecting: false,

    _hadError: false,

    _parent: null,

    _host: null,

    _readableState: ReadableState {

      objectMode: false,

      highWaterMark: 16384,

      buffer: BufferList { head: null, tail: null, length: 0 },

      length: 0,

      pipes: null,

      pipesCount: 0,

      flowing: true,

      ended: false,

      endEmitted: false,

      reading: true,

      sync: false,

      needReadable: true,

      emittedReadable: false,

      readableListening: false,

      resumeScheduled: false,

      paused: false,

      emitClose: false,

      autoDestroy: false,

      destroyed: false,

      defaultEncoding: 'utf8',

      awaitDrain: 0,

      readingMore: false,

      decoder: null,

      encoding: null

    },

    readable: true,

    _events: [Object: null prototype] {

      end: [Array],

      timeout: [Function: socketOnTimeout],

      data: [Function: bound socketOnData],

      error: [Function: socketOnError],

      close: [Array],

      drain: [Function: bound socketOnDrain],

      resume: [Function: onSocketResume],

      pause: [Function: onSocketPause]

    },

    _eventsCount: 8,

    _maxListeners: undefined,

    _writableState: WritableState {

      objectMode: false,

      highWaterMark: 16384,

      finalCalled: false,

      needDrain: false,

      ending: false,

      ended: false,

      finished: false,

      destroyed: false,

      decodeStrings: false,

      defaultEncoding: 'utf8',

      length: 0,

      writing: false,

      corked: 0,

      sync: false,

      bufferProcessing: false,

      onwrite: [Function: bound onwrite],

      writecb: null,

      writelen: 0,

      afterWriteTickInfo: null,

      bufferedRequest: null,

      lastBufferedRequest: null,

      pendingcb: 0,

      prefinished: false,

      errorEmitted: false,

      emitClose: false,

      autoDestroy: false,

      bufferedRequestCount: 0,

      corkedRequestsFree: [Object]

    },

    writable: true,

    allowHalfOpen: true,

    _sockname: null,

    _pendingData: null,

    _pendingEncoding: '',

    server: Server {

      _events: [Object: null prototype],

      _eventsCount: 2,

      _maxListeners: undefined,

      _connections: 4,

      _handle: [TCP],

      _usingWorkers: false,

      _workers: [],

      _unref: false,

      allowHalfOpen: true,

      pauseOnConnect: false,

      httpAllowHalfOpen: false,

      timeout: 120000,

      keepAliveTimeout: 5000,

      maxHeadersCount: null,

      headersTimeout: 40000,

      _connectionKey: '4:0.0.0.0:20230',

      [Symbol(IncomingMessage)]: [Function: IncomingMessage],

      [Symbol(ServerResponse)]: [Function: ServerResponse],

      [Symbol(asyncId)]: 13

    },

    _server: Server {

      _events: [Object: null prototype],

      _eventsCount: 2,

      _maxListeners: undefined,

      _connections: 4,

      _handle: [TCP],

      _usingWorkers: false,

      _workers: [],

      _unref: false,

      allowHalfOpen: true,

      pauseOnConnect: false,

      httpAllowHalfOpen: false,

      timeout: 120000,

      keepAliveTimeout: 5000,

      maxHeadersCount: null,

      headersTimeout: 40000,

      _connectionKey: '4:0.0.0.0:20230',

      [Symbol(IncomingMessage)]: [Function: IncomingMessage],

      [Symbol(ServerResponse)]: [Function: ServerResponse],

      [Symbol(asyncId)]: 13

    },

    timeout: 120000,

    parser: HTTPParser {

      '0': [Function: parserOnHeaders],

      '1': [Function: parserOnHeadersComplete],

      '2': [Function: parserOnBody],

      '3': [Function: parserOnMessageComplete],

      '4': [Function: bound onParserExecute],

      _headers: [],

      _url: '',

      socket: [Circular],

      incoming: [Circular],

      outgoing: null,

      maxHeaderPairs: 2000,

      _consumed: true,

      onIncoming: [Function: bound parserOnIncoming],

      parsingHeadersStart: 1600144170273

    },

    on: [Function: socketListenerWrap],

    addListener: [Function: socketListenerWrap],

    prependListener: [Function: socketListenerWrap],

    _paused: false,

    _httpMessage: ServerResponse {

      _events: [Object: null prototype],

      _eventsCount: 1,

      _maxListeners: undefined,

      outputData: [],

      outputSize: 0,

      writable: true,

      _last: false,

      chunkedEncoding: false,

      shouldKeepAlive: true,

      useChunkedEncodingByDefault: true,

      sendDate: true,

      _removedConnection: false,

      _removedContLen: false,

      _removedTE: false,

      _contentLength: null,

      _hasBody: true,

      _trailer: '',

      finished: false,

      _headerSent: false,

      socket: [Circular],

      connection: [Circular],

      _header: null,

      _onPendingData: [Function: bound updateOutgoingData],

      _sent100: false,

      _expect_continue: false,

      req: [Circular],

      locals: [Object: null prototype] {},

      writeHead: [Function: writeHead],

      end: [Function: end],

      [Symbol(kNeedDrain)]: false,

      [Symbol(isCorked)]: false,

      [Symbol(kOutHeaders)]: [Object: null prototype]

    },

    _peername: { address: '127.0.0.1', family: 'IPv4', port: 51058 },

    [Symbol(asyncId)]: 1341,

    [Symbol(kHandle)]: TCP {

      reading: true,

      onconnection: null,

      _consumed: true,

      [Symbol(owner)]: [Circular]

    },

    [Symbol(lastWriteQueueSize)]: 0,

    [Symbol(timeout)]: Timeout {

      _idleTimeout: 120000,

      _idlePrev: [TimersList],

      _idleNext: [Timeout],

      _idleStart: 32355,

      _onTimeout: [Function: bound ],

      _timerArgs: undefined,

      _repeat: null,

      _destroyed: false,

      [Symbol(refed)]: false,

      [Symbol(asyncId)]: 1376,

      [Symbol(triggerId)]: 1343

    },

    [Symbol(kBuffer)]: null,

    [Symbol(kBufferCb)]: null,

    [Symbol(kBufferGen)]: null,

    [Symbol(kBytesRead)]: 0,

    [Symbol(kBytesWritten)]: 0

  },

  connection: Socket {

    connecting: false,

    _hadError: false,

    _parent: null,

    _host: null,

    _readableState: ReadableState {

      objectMode: false,

      highWaterMark: 16384,

      buffer: BufferList { head: null, tail: null, length: 0 },

      length: 0,

      pipes: null,

      pipesCount: 0,

      flowing: true,

      ended: false,

      endEmitted: false,

      reading: true,

      sync: false,

      needReadable: true,

      emittedReadable: false,

      readableListening: false,

      resumeScheduled: false,

      paused: false,

      emitClose: false,

      autoDestroy: false,

      destroyed: false,

      defaultEncoding: 'utf8',

      awaitDrain: 0,

      readingMore: false,

      decoder: null,

      encoding: null

    },

    readable: true,

    _events: [Object: null prototype] {

      end: [Array],

      timeout: [Function: socketOnTimeout],

      data: [Function: bound socketOnData],

      error: [Function: socketOnError],

      close: [Array],

      drain: [Function: bound socketOnDrain],

      resume: [Function: onSocketResume],

      pause: [Function: onSocketPause]

    },

    _eventsCount: 8,

    _maxListeners: undefined,

    _writableState: WritableState {

      objectMode: false,

      highWaterMark: 16384,

      finalCalled: false,

      needDrain: false,

      ending: false,

      ended: false,

      finished: false,

      destroyed: false,

      decodeStrings: false,

      defaultEncoding: 'utf8',

      length: 0,

      writing: false,

      corked: 0,

      sync: false,

      bufferProcessing: false,

      onwrite: [Function: bound onwrite],

      writecb: null,

      writelen: 0,

      afterWriteTickInfo: null,

      bufferedRequest: null,

      lastBufferedRequest: null,

      pendingcb: 0,

      prefinished: false,

      errorEmitted: false,

      emitClose: false,

      autoDestroy: false,

      bufferedRequestCount: 0,

      corkedRequestsFree: [Object]

    },

    writable: true,

    allowHalfOpen: true,

    _sockname: null,

    _pendingData: null,

    _pendingEncoding: '',

    server: Server {

      _events: [Object: null prototype],

      _eventsCount: 2,

      _maxListeners: undefined,

      _connections: 4,

      _handle: [TCP],

      _usingWorkers: false,

      _workers: [],

      _unref: false,

      allowHalfOpen: true,

      pauseOnConnect: false,

      httpAllowHalfOpen: false,

      timeout: 120000,

      keepAliveTimeout: 5000,

      maxHeadersCount: null,

      headersTimeout: 40000,

      _connectionKey: '4:0.0.0.0:20230',

      [Symbol(IncomingMessage)]: [Function: IncomingMessage],

      [Symbol(ServerResponse)]: [Function: ServerResponse],

      [Symbol(asyncId)]: 13

    },

    _server: Server {

      _events: [Object: null prototype],

      _eventsCount: 2,

      _maxListeners: undefined,

      _connections: 4,

      _handle: [TCP],

      _usingWorkers: false,

      _workers: [],

      _unref: false,

      allowHalfOpen: true,

      pauseOnConnect: false,

      httpAllowHalfOpen: false,

      timeout: 120000,

      keepAliveTimeout: 5000,

      maxHeadersCount: null,

      headersTimeout: 40000,

      _connectionKey: '4:0.0.0.0:20230',

      [Symbol(IncomingMessage)]: [Function: IncomingMessage],

      [Symbol(ServerResponse)]: [Function: ServerResponse],

      [Symbol(asyncId)]: 13

    },

    timeout: 120000,

    parser: HTTPParser {

      '0': [Function: parserOnHeaders],

      '1': [Function: parserOnHeadersComplete],

      '2': [Function: parserOnBody],

      '3': [Function: parserOnMessageComplete],

      '4': [Function: bound onParserExecute],

      _headers: [],

      _url: '',

      socket: [Circular],

      incoming: [Circular],

      outgoing: null,

      maxHeaderPairs: 2000,

      _consumed: true,

      onIncoming: [Function: bound parserOnIncoming],

      parsingHeadersStart: 1600144170273

    },

    on: [Function: socketListenerWrap],

    addListener: [Function: socketListenerWrap],

    prependListener: [Function: socketListenerWrap],

    _paused: false,

    _httpMessage: ServerResponse {

      _events: [Object: null prototype],

      _eventsCount: 1,

      _maxListeners: undefined,

      outputData: [],

      outputSize: 0,

      writable: true,

      _last: false,

      chunkedEncoding: false,

      shouldKeepAlive: true,

      useChunkedEncodingByDefault: true,

      sendDate: true,

      _removedConnection: false,

      _removedContLen: false,

      _removedTE: false,

      _contentLength: null,

      _hasBody: true,

      _trailer: '',

      finished: false,

      _headerSent: false,

      socket: [Circular],

      connection: [Circular],

      _header: null,

      _onPendingData: [Function: bound updateOutgoingData],

      _sent100: false,

      _expect_continue: false,

      req: [Circular],

      locals: [Object: null prototype] {},

      writeHead: [Function: writeHead],

      end: [Function: end],

      [Symbol(kNeedDrain)]: false,

      [Symbol(isCorked)]: false,

      [Symbol(kOutHeaders)]: [Object: null prototype]

    },

    _peername: { address: '127.0.0.1', family: 'IPv4', port: 51058 },

    [Symbol(asyncId)]: 1341,

    [Symbol(kHandle)]: TCP {

      reading: true,

      onconnection: null,

      _consumed: true,

      [Symbol(owner)]: [Circular]

    },

    [Symbol(lastWriteQueueSize)]: 0,

    [Symbol(timeout)]: Timeout {

      _idleTimeout: 120000,

      _idlePrev: [TimersList],

      _idleNext: [Timeout],

      _idleStart: 32355,

      _onTimeout: [Function: bound ],

      _timerArgs: undefined,

      _repeat: null,

      _destroyed: false,

      [Symbol(refed)]: false,

      [Symbol(asyncId)]: 1376,

      [Symbol(triggerId)]: 1343

    },

    [Symbol(kBuffer)]: null,

    [Symbol(kBufferCb)]: null,

    [Symbol(kBufferGen)]: null,

    [Symbol(kBytesRead)]: 0,

    [Symbol(kBytesWritten)]: 0

  },

  httpVersionMajor: 1,

  httpVersionMinor: 1,

  httpVersion: '1.1',

  complete: true,

  headers: {

    host: 'localhost:20230',

    connection: 'keep-alive',

    'content-length': '32',

    accept: 'application/json, text/plain, */*',

    'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.102

 Safari/537.36',

    'content-type': 'application/json;charset=UTF-8',

    origin: 'http://localhost:20727',

    'sec-fetch-site': 'same-site',

    'sec-fetch-mode': 'cors',

    'sec-fetch-dest': 'empty',

    referer: 'http://localhost:20727/',

    'accept-encoding': 'gzip, deflate, br',

    'accept-language': 'zh-CN,zh;q=0.9',

    cookie: 'connect.sid=s%3A6D00jCBjQVjI9oxdDVaixKe_59saqDp1.QktqxPSzbyr6uflfUP7pxzAV18FaV7Cj3b20db0jlHI'

  },

  rawHeaders: [

    'Host',

    'localhost:20230',

    'Connection',

    'keep-alive',

    'Content-Length',

    '32',

    'Accept',

    'application/json, text/plain, */*',

    'User-Agent',

    'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.102 Safari/537.36

',

    'Content-Type',

    'application/json;charset=UTF-8',

    'Origin',

    'http://localhost:20727',

    'Sec-Fetch-Site',

    'same-site',

    'Sec-Fetch-Mode',

    'cors',

    'Sec-Fetch-Dest',

    'empty',

    'Referer',

    'http://localhost:20727/',

    'Accept-Encoding',

    'gzip, deflate, br',

    'Accept-Language',

    'zh-CN,zh;q=0.9',

    'Cookie',

    'connect.sid=s%3A6D00jCBjQVjI9oxdDVaixKe_59saqDp1.QktqxPSzbyr6uflfUP7pxzAV18FaV7Cj3b20db0jlHI'

  ],

  trailers: {},

  rawTrailers: [],

  aborted: false,

  upgrade: false,

  url: '/login',

  method: 'POST',

  statusCode: null,

  statusMessage: null,

  client: Socket {

    connecting: false,

    _hadError: false,

    _parent: null,

    _host: null,

    _readableState: ReadableState {

      objectMode: false,

      highWaterMark: 16384,

      buffer: BufferList { head: null, tail: null, length: 0 },

      length: 0,

      pipes: null,

      pipesCount: 0,

      flowing: true,

      ended: false,

      endEmitted: false,

      reading: true,

      sync: false,

      needReadable: true,

      emittedReadable: false,

      readableListening: false,

      resumeScheduled: false,

      paused: false,

      emitClose: false,

      autoDestroy: false,

      destroyed: false,

      defaultEncoding: 'utf8',

      awaitDrain: 0,

      readingMore: false,

      decoder: null,

      encoding: null

    },

    readable: true,

    _events: [Object: null prototype] {

      end: [Array],

      timeout: [Function: socketOnTimeout],

      data: [Function: bound socketOnData],

      error: [Function: socketOnError],

      close: [Array],

      drain: [Function: bound socketOnDrain],

      resume: [Function: onSocketResume],

      pause: [Function: onSocketPause]

    },

    _eventsCount: 8,

    _maxListeners: undefined,

    _writableState: WritableState {

      objectMode: false,

      highWaterMark: 16384,

      finalCalled: false,

      needDrain: false,

      ending: false,

      ended: false,

      finished: false,

      destroyed: false,

      decodeStrings: false,

      defaultEncoding: 'utf8',

      length: 0,

      writing: false,

      corked: 0,

      sync: false,

      bufferProcessing: false,

      onwrite: [Function: bound onwrite],

      writecb: null,

      writelen: 0,

      afterWriteTickInfo: null,

      bufferedRequest: null,

      lastBufferedRequest: null,

      pendingcb: 0,

      prefinished: false,

      errorEmitted: false,

      emitClose: false,

      autoDestroy: false,

      bufferedRequestCount: 0,

      corkedRequestsFree: [Object]

    },

    writable: true,

    allowHalfOpen: true,

    _sockname: null,

    _pendingData: null,

    _pendingEncoding: '',

    server: Server {

      _events: [Object: null prototype],

      _eventsCount: 2,

      _maxListeners: undefined,

      _connections: 4,

      _handle: [TCP],

      _usingWorkers: false,

      _workers: [],

      _unref: false,

      allowHalfOpen: true,

      pauseOnConnect: false,

      httpAllowHalfOpen: false,

      timeout: 120000,

      keepAliveTimeout: 5000,

      maxHeadersCount: null,

      headersTimeout: 40000,

      _connectionKey: '4:0.0.0.0:20230',

      [Symbol(IncomingMessage)]: [Function: IncomingMessage],

      [Symbol(ServerResponse)]: [Function: ServerResponse],

      [Symbol(asyncId)]: 13

    },

    _server: Server {

      _events: [Object: null prototype],

      _eventsCount: 2,

      _maxListeners: undefined,

      _connections: 4,

      _handle: [TCP],

      _usingWorkers: false,

      _workers: [],

      _unref: false,

      allowHalfOpen: true,

      pauseOnConnect: false,

      httpAllowHalfOpen: false,

      timeout: 120000,

      keepAliveTimeout: 5000,

      maxHeadersCount: null,

      headersTimeout: 40000,

      _connectionKey: '4:0.0.0.0:20230',

      [Symbol(IncomingMessage)]: [Function: IncomingMessage],

      [Symbol(ServerResponse)]: [Function: ServerResponse],

      [Symbol(asyncId)]: 13

    },

    timeout: 120000,

    parser: HTTPParser {

      '0': [Function: parserOnHeaders],

      '1': [Function: parserOnHeadersComplete],

      '2': [Function: parserOnBody],

      '3': [Function: parserOnMessageComplete],

      '4': [Function: bound onParserExecute],

      _headers: [],

      _url: '',

      socket: [Circular],

      incoming: [Circular],

      outgoing: null,

      maxHeaderPairs: 2000,

      _consumed: true,

      onIncoming: [Function: bound parserOnIncoming],

      parsingHeadersStart: 1600144170273

    },

    on: [Function: socketListenerWrap],

    addListener: [Function: socketListenerWrap],

    prependListener: [Function: socketListenerWrap],

    _paused: false,

    _httpMessage: ServerResponse {

      _events: [Object: null prototype],

      _eventsCount: 1,

      _maxListeners: undefined,

      outputData: [],

      outputSize: 0,

      writable: true,

      _last: false,

      chunkedEncoding: false,

      shouldKeepAlive: true,

      useChunkedEncodingByDefault: true,

      sendDate: true,

      _removedConnection: false,

      _removedContLen: false,

      _removedTE: false,

      _contentLength: null,

      _hasBody: true,

      _trailer: '',

      finished: false,

      _headerSent: false,

      socket: [Circular],

      connection: [Circular],

      _header: null,

      _onPendingData: [Function: bound updateOutgoingData],

      _sent100: false,

      _expect_continue: false,

      req: [Circular],

      locals: [Object: null prototype] {},

      writeHead: [Function: writeHead],

      end: [Function: end],

      [Symbol(kNeedDrain)]: false,

      [Symbol(isCorked)]: false,

      [Symbol(kOutHeaders)]: [Object: null prototype]

    },

    _peername: { address: '127.0.0.1', family: 'IPv4', port: 51058 },

    [Symbol(asyncId)]: 1341,

    [Symbol(kHandle)]: TCP {

      reading: true,

      onconnection: null,

      _consumed: true,

      [Symbol(owner)]: [Circular]

    },

    [Symbol(lastWriteQueueSize)]: 0,

    [Symbol(timeout)]: Timeout {

      _idleTimeout: 120000,

      _idlePrev: [TimersList],

      _idleNext: [Timeout],

      _idleStart: 32355,

      _onTimeout: [Function: bound ],

      _timerArgs: undefined,

      _repeat: null,

      _destroyed: false,

      [Symbol(refed)]: false,

      [Symbol(asyncId)]: 1376,

      [Symbol(triggerId)]: 1343

    },

    [Symbol(kBuffer)]: null,

    [Symbol(kBufferCb)]: null,

    [Symbol(kBufferGen)]: null,

    [Symbol(kBytesRead)]: 0,

    [Symbol(kBytesWritten)]: 0

  },

  _consuming: true,

  _dumped: false,

  next: [Function: next],

  baseUrl: '',

  originalUrl: '/login',

  _parsedUrl: Url {

    protocol: null,

    slashes: null,

    auth: null,

    host: null,

    port: null,

    hostname: null,

    hash: null,

    search: null,

    query: null,

    pathname: '/login',

    path: '/login',

    href: '/login',

    _raw: '/login'

  },

  params: {},

  query: {},

  res: ServerResponse {

    _events: [Object: null prototype] { finish: [Function: bound resOnFinish] },

    _eventsCount: 1,

    _maxListeners: undefined,

    outputData: [],

    outputSize: 0,

    writable: true,

    _last: false,

    chunkedEncoding: false,

    shouldKeepAlive: true,

    useChunkedEncodingByDefault: true,

    sendDate: true,

    _removedConnection: false,

    _removedContLen: false,

    _removedTE: false,

    _contentLength: null,

    _hasBody: true,

    _trailer: '',

    finished: false,

    _headerSent: false,

    socket: Socket {

      connecting: false,

      _hadError: false,

      _parent: null,

      _host: null,

      _readableState: [ReadableState],

      readable: true,

      _events: [Object: null prototype],

      _eventsCount: 8,

      _maxListeners: undefined,

      _writableState: [WritableState],

      writable: true,

      allowHalfOpen: true,

      _sockname: null,

      _pendingData: null,

      _pendingEncoding: '',

      server: [Server],

      _server: [Server],

      timeout: 120000,

      parser: [HTTPParser],

      on: [Function: socketListenerWrap],

      addListener: [Function: socketListenerWrap],

      prependListener: [Function: socketListenerWrap],

      _paused: false,

      _httpMessage: [Circular],

      _peername: [Object],

      [Symbol(asyncId)]: 1341,

      [Symbol(kHandle)]: [TCP],

      [Symbol(lastWriteQueueSize)]: 0,

      [Symbol(timeout)]: Timeout {

        _idleTimeout: 120000,

        _idlePrev: [TimersList],

        _idleNext: [Timeout],

        _idleStart: 32355,

        _onTimeout: [Function: bound ],

        _timerArgs: undefined,

        _repeat: null,

        _destroyed: false,

        [Symbol(refed)]: false,

        [Symbol(asyncId)]: 1376,

        [Symbol(triggerId)]: 1343

      },

      [Symbol(kBuffer)]: null,

      [Symbol(kBufferCb)]: null,

      [Symbol(kBufferGen)]: null,

      [Symbol(kBytesRead)]: 0,

      [Symbol(kBytesWritten)]: 0

    },

    connection: Socket {

      connecting: false,

      _hadError: false,

      _parent: null,

      _host: null,

      _readableState: [ReadableState],

      readable: true,

      _events: [Object: null prototype],

      _eventsCount: 8,

      _maxListeners: undefined,

      _writableState: [WritableState],

      writable: true,

      allowHalfOpen: true,

      _sockname: null,

      _pendingData: null,

      _pendingEncoding: '',

      server: [Server],

      _server: [Server],

      timeout: 120000,

      parser: [HTTPParser],

      on: [Function: socketListenerWrap],

      addListener: [Function: socketListenerWrap],

      prependListener: [Function: socketListenerWrap],

      _paused: false,

      _httpMessage: [Circular],

      _peername: [Object],

      [Symbol(asyncId)]: 1341,

      [Symbol(kHandle)]: [TCP],

      [Symbol(lastWriteQueueSize)]: 0,

      [Symbol(timeout)]: Timeout {

        _idleTimeout: 120000,

        _idlePrev: [TimersList],

        _idleNext: [Timeout],

        _idleStart: 32355,

        _onTimeout: [Function: bound ],

        _timerArgs: undefined,

        _repeat: null,

        _destroyed: false,

        [Symbol(refed)]: false,

        [Symbol(asyncId)]: 1376,

        [Symbol(triggerId)]: 1343

      },

      [Symbol(kBuffer)]: null,

      [Symbol(kBufferCb)]: null,

      [Symbol(kBufferGen)]: null,

      [Symbol(kBytesRead)]: 0,

      [Symbol(kBytesWritten)]: 0

    },

    _header: null,

    _onPendingData: [Function: bound updateOutgoingData],

    _sent100: false,

    _expect_continue: false,

    req: [Circular],

    locals: [Object: null prototype] {},

    writeHead: [Function: writeHead],

    end: [Function: end],

    [Symbol(kNeedDrain)]: false,

    [Symbol(isCorked)]: false,

    [Symbol(kOutHeaders)]: [Object: null prototype] {

      'x-powered-by': [Array],

      'surrogate-control': [Array],

      'cache-control': [Array],

      pragma: [Array],

      expires: [Array],

      'access-control-allow-origin': [Array],

      vary: [Array],

      'access-control-allow-credentials': [Array]

    }

  },

  body: { username: '215', password: '' },

  _body: true,

  length: undefined,

  _parsedOriginalUrl: Url {

    protocol: null,

    slashes: null,

    auth: null,

    host: null,

    port: null,

    hostname: null,

    hash: null,

    search: null,

    query: null,

    pathname: '/login',

    path: '/login',

    href: '/login',

    _raw: '/login'

  },

  sessionStore: MemoryStore {

    _events: [Object: null prototype] {

      disconnect: [Function: ondisconnect],

      connect: [Function: onconnect]

    },

    _eventsCount: 2,

    _maxListeners: undefined,

    sessions: [Object: null prototype] {

      'yJ-BidUl1xgSHDmvlZCnGrGpOXdPEuGG': '{"cookie":{"originalMaxAge":null,"expires":null,"httpOnly":true,"path":"/","s

ameSite":"lax"}}',

      '6D00jCBjQVjI9oxdDVaixKe_59saqDp1': '{"cookie":{"originalMaxAge":null,"expires":null,"httpOnly":true,"path":"/","s

ameSite":"lax"}}',

      QM96Ej7oEfXGsCOP8ZrYpwq5jByHCHzy: '{"cookie":{"originalMaxAge":null,"expires":null,"httpOnly":true,"path":"/","sam

eSite":"lax"}}'

    },

    generate: [Function]

  },

  sessionID: '6D00jCBjQVjI9oxdDVaixKe_59saqDp1',

  session: Session {

    cookie: {

      path: '/',

      _expires: null,

      originalMaxAge: null,

      httpOnly: true,

      sameSite: 'lax'

    }

  },

  route: Route { path: '/login', stack: [ [Layer] ], methods: { post: true } }

}


End

2007 to 2023 HP and Dell Servers Comparison

  HP Gen5 to Gen11  using ChatGPT HP ProLiant Gen Active Years CPU Socket Popular HP CPUs Cores Base Clock Max RAM Capacity Comparable Dell ...