The above is a selenium-webdriver Cycle click Baidu search results and get a new page handler article , Random access to Baidu search results in different id Result , The implementation code is as follows :

 #coding:utf-
import random
from pythontest.commlib.baselib import TestLog log = TestLog().getlog()
def randomdata(): i =
while i < :
randint_data = random.randint(,) # take 10 A random integer within
randrange_data = random.randrange(, , ) # take 1-10 A single digit within , Or take 11-100 Within two digits
num = "random -->" , randint_data , randrange_data
log.info(num)
i = i +
# log.info( ".//*[@id='%s']/h3/a" %(j) ) # Parameter input formatting randomdata()

Comparison of two kinds of random number results :

python(random modular ) take 10 More articles on random numbers within

  1. Python random modular Example

    Recently we used random numbers , This is a summary of the inquiry data Python random modular ( Get random numbers ) Common methods and examples . 1.random.random  random.random() Used to generate a 0 To 1 The number of random characters of : ...

  2. python random modular - Foal's column - Blog channel - CSDN.NET

    python random modular - Foal's column - Blog channel - CSDN.NET python random modular classification : python 2011-11-15 15:31 6037 Human reading Comment on (2) ...

  3. python random modular (14)

    random The module includes functions that return random numbers , Can be used to simulate or any program that produces random output . One .random Module common function introduction random.random() — Generate a from 0.0( contain ) To 1.0( It doesn't contain ) Between ...

  4. python random Module import and usage

    random It's a program random number , It's used in a lot of places , Verification Code , The name of the image uploaded, etc , Now let's talk about it. python random Module import and usage 1, Module import import random 2,random usage random.r ...

  5. python random modular ( random number ) Detailed explanation

    Import before use random modular import random random.randomrandom.random() Used to generate a 0 To 1 The number of random characters of : 0 <= n < 1.0 random ...

  6. Python | random modular :Python How to generate random numbers and random sampling in ?

    random Is usually used in the development process of a module , This module implements pseudo-random number generator of various distributions , And various practical functions related to random numbers . Basic functions random() In the interval [0.0, 1.0) The random floating-point number is generated uniformly in the system , Is the mould ...

  7. Python random modular ( Get random numbers ) Common methods and examples

    random.randomrandom.random() Used to generate a 0 To 1 The number of random characters of : 0 <= n < 1.0 random.uniformrandom.uniform(a, b), use ...

  8. Python random modular ( Get random numbers )

    1.random.random Randomly generate one 0 To 1 Is a random floating point number : 0 <= n < 1.0 In [2]: print random.random() 0.544824016934 2.r ...

  9. python random modular ( Get random numbers )

    If you want to use random modular , You need to import import random 1.random.random()  # Used to generate a 0 To 1 Is a random floating point number 2.random.uniform(a,b)  # Used to generate a ...

Random recommendation

  1. JavaScript Series articles : from let and const Talking about

    It's been many years since I registered my blog Park account , If you have something to do, you often come to visit , I feel that the students in the blog park have been very active all the time , Compared with other communities in China , The technical atmosphere here is very strong , Perfect for learning and communicating , So I also decided to stay here , ad locum , Bloggers hope to keep on writing ...

  2. Esfog_UnityShader course _ Preface

    A lot of people are learning Unity The time is right Shader It's all a piece of knowledge , As a newcomer who has just been on the job for half a year Shader It's not long , It's because they are new people that they can learn Shader The difficulties and confusions that I met in my life , But the information is hard to find , A few rare things on the Internet ...

  3. 【AngularJS】—— 13 service Service

    stay AngularJS There are a lot of services in , Common ones like $http,$location wait . This article will introduce the content of : 1 $http such Angular The use of services provided 2 How to customize services , And summarize the service needs to pay attention to ...

  4. Spark Streaming reveal Day17 Dynamic allocation of resources

    Spark Streaming reveal Day17 Dynamic allocation of resources today , Let's take a look at one in Spark A very important feature in : Dynamic allocation of resources . Why dynamic allocation ? On Spark Keep running , It also consumes a lot of resources , By default ...

  5. from Thread.start() Methods Thread Source code , many times start What about a thread

    This article serves as Thread Class source code analysis supplement , From one side Thread Source code . Also answered the interview questions :" many times start What about a thread ?" The answer is :java.lang.IllegalTh ...

  6. Reprint c++ Often forgotten knowledge

    C++ Some of my knowledge is fragmentary , Make some notes and summaries in the form of the following list , For reference . 1. Assignment operator overload ( Deep copy ): (1) Because the target object may refer to some previous data , So first of all delete These data : (2) Notice that the object can ...

  7. VO、DTO、DO、PO

    The entity classes in the domain model can be subdivided into 4 Types :VO.DTO.DO.PO. PO(Persistent Object): Persistent object , Represents the data structure of the persistence layer ( Such as database table ): DO(Domain Object): Domain vs ...

  8. vue Routing realizes multi view single page application

    Multi view single page application : In a page to achieve different switching of multiple pages ,url And it has changed accordingly . router-view combination this.$router.push("/pickUp") Realization , The effect is as follows : When ...

  9. redis The generic function

    redis The generic function construct command / Method / function Description Creates a Redis client Create a Redis client Example $redis = new R ...

  10. table-layout:fixed; Table scale fixed

    Fixed table layout : Fixed table layout compared to automatic table layout , Allows browsers to lay out tables faster . In a fixed table layout , The horizontal layout only depends on the width of the table . Column width . Table border width . Cell spacing , It has nothing to do with the contents of the cell . By using fixed forms ...