Python string Regular Processing instance

Source: Internet
Author: User

Tag:pos   move   ui   for    Analysis     9.1   www   app   odi   

#coding: Utf-8 "Created on 2017?? 9?? 6?? @author: Li.liu ' from selenium import webdriverfrom selenium.webdriver.common.action_chains Import Actionchainsimport osimport timeimport reurl= ' http://101.37.179.183 ' #url = ' http://www.baidu.com ' ' xpath= '//*[@id = "Header"]/div[4]/span[1]/a ' xpath1= '//*[@id = "header"]/div[4]/span[2]/a ' Driver=webdriver. Chrome () driver.get (URL) #elem =driver.find_element_by_xpath (XPath) #ActionChains (driver). Move_to_element (Elem).    Perform () #time. Sleep (1) Print Driver.find_element_by_xpath (xpath1). is_selected () print 1driver.quit () Try: Driver.find_element_by_xpath (xpath1). Click () Except:elem=driver.find_element_by_xpath (XPath) actionchains (driver ). Move_to_element (Elem). Perform () Driver.find_element_by_xpath (xpath1). Click () print 1n= ' n ' m= ' m ' t={n:[1,2],m:[ 3,4,5]}l= ' L ' t[l]=[]t[l].append (6) t[l].append (7) t[l].extend (T[n]) print type (t) for I in T:print i,t[i]t[l]=[]print ' \ n ============== ' for (d,k) in T.items (): Print D,k "" "A=1b=2b=a+ba=b-ab=b-aprint a,bdEF T (*t): Print type (t) def H (**t): Print TT (+) h (a={},b=2,c=3) print ' demand analysis ' print ' ' ' c=0 ' for I in A:try: print int (i) c+=1 except:passprint C ' ' a= ' abcd1.2dbdf4dd32da2dfs9df ' s=re.findall (' \d ', a) t= ' for I in S:t=t+iprint ts=re.compile (' \d ') c=re.sub (S, ', a) print C

  

Python string Regular Processing instance

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.