faker.providers.user_agent

class faker.providers.user_agent.Provider(generator)

Bases: faker.providers.BaseProvider

Implement default user agent provider for Faker.

android_platform_token()

Generate an Android platform token used in user agent strings.

Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.android_platform_token()
...
'Android 7.1'
'Android 3.2.3'
'Android 5.0.2'
'Android 7.1.2'
'Android 3.2.5'
chrome(version_from=13, version_to=63, build_from=800, build_to=899)

Generate a Chrome web browser user agent string.

Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.chrome()
...
'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/534.1 (KHTML, like Gecko) Chrome/43.0.845.0 Safari/534.1'
'Mozilla/5.0 (Windows NT 5.1) AppleWebKit/536.1 (KHTML, like Gecko) Chrome/46.0.833.0 Safari/536.1'
'Mozilla/5.0 (iPad; CPU iPad OS 10_3_4 like Mac OS X) AppleWebKit/536.1 (KHTML, like Gecko) CriOS/26.0.877.0 Mobile/13Z933 Safari/536.1'
'Mozilla/5.0 (Linux; Android 5.0.2) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/21.0.819.0 Safari/535.1'
'Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10 6_5) AppleWebKit/536.2 (KHTML, like Gecko) Chrome/52.0.814.0 Safari/536.2'
firefox()

Generate a Mozilla Firefox web browser user agent string.

Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.firefox()
...
'Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10 6_5; rv:1.9.5.20) Gecko/2010-09-09 13:28:06 Firefox/3.6.9'
'Mozilla/5.0 (iPhone; CPU iPhone OS 12_4_8 like Mac OS X) AppleWebKit/536.2 (KHTML, like Gecko) FxiOS/17.5h1393.0 Mobile/09X753 Safari/536.2'
'Mozilla/5.0 (Windows NT 10.0; de-BE; rv:1.9.0.20) Gecko/2015-11-23 10:33:37 Firefox/11.0'
'Mozilla/5.0 (X11; Linux i686; rv:1.9.5.20) Gecko/2016-07-08 06:49:34 Firefox/13.0'
'Mozilla/5.0 (X11; Linux i686; rv:1.9.7.20) Gecko/2012-02-09 20:35:11 Firefox/3.6.16'
internet_explorer()

Generate an IE web browser user agent string.

Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.internet_explorer()
...
'Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 10.0; Trident/4.0)'
'Mozilla/5.0 (compatible; MSIE 7.0; Windows NT 5.2; Trident/4.1)'
'Mozilla/5.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0)'
'Mozilla/5.0 (compatible; MSIE 9.0; Windows 98; Win 9x 4.90; Trident/4.0)'
'Mozilla/5.0 (compatible; MSIE 5.0; Windows NT 6.0; Trident/4.0)'
ios_platform_token()

Generate an iOS platform token used in user agent strings.

Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.ios_platform_token()
...
'iPad; CPU iPad OS 9_3_6 like Mac OS X'
'iPhone; CPU iPhone OS 7_1_2 like Mac OS X'
'iPad; CPU iPad OS 9_3_6 like Mac OS X'
'iPad; CPU iPad OS 10_3_3 like Mac OS X'
'iPad; CPU iPad OS 12_4_8 like Mac OS X'
linux_platform_token()

Generate a Linux platform token used in user agent strings.

Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.linux_platform_token()
...
'X11; Linux x86_64'
'X11; Linux x86_64'
'X11; Linux i686'
'X11; Linux x86_64'
'X11; Linux x86_64'
linux_processor()

Generate a Linux processor token used in user agent strings.

Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.linux_processor()
...
'x86_64'
'x86_64'
'i686'
'x86_64'
'x86_64'
mac_platform_token()

Generate a MacOS platform token used in user agent strings.

Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.mac_platform_token()
...
'Macintosh; U; PPC Mac OS X 10 11_0'
'Macintosh; U; Intel Mac OS X 10 12_6'
'Macintosh; U; Intel Mac OS X 10 12_5'
'Macintosh; PPC Mac OS X 10 7_4'
'Macintosh; PPC Mac OS X 10 6_9'
mac_processor()

Generate a MacOS processor token used in user agent strings.

Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.mac_processor()
...
'U; PPC'
'U; PPC'
'Intel'
'U; Intel'
'U; PPC'
opera()

Generate an Opera web browser user agent string.

Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.opera()
...
'Opera/9.61.(X11; Linux x86_64; mt-MT) Presto/2.9.168 Version/12.00'
'Opera/8.46.(X11; Linux x86_64; os-RU) Presto/2.9.178 Version/10.00'
'Opera/8.49.(Windows NT 10.0; ce-RU) Presto/2.9.189 Version/12.00'
'Opera/8.55.(Windows NT 6.2; bo-IN) Presto/2.9.175 Version/12.00'
'Opera/9.66.(Windows NT 5.0; the-NP) Presto/2.9.190 Version/12.00'
safari()

Generate a Safari web browser user agent string.

Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.safari()
...
'Mozilla/5.0 (iPod; U; CPU iPhone OS 4_1 like Mac OS X; mn-MN) AppleWebKit/534.49.4 (KHTML, like Gecko) Version/3.0.5 Mobile/8B115 Safari/6534.49.4'
'Mozilla/5.0 (iPod; U; CPU iPhone OS 4_3 like Mac OS X; om-ET) AppleWebKit/535.10.3 (KHTML, like Gecko) Version/4.0.5 Mobile/8B111 Safari/6535.10.3'
'Mozilla/5.0 (Macintosh; PPC Mac OS X 10 10_1 rv:3.0; the-NP) AppleWebKit/531.6.6 (KHTML, like Gecko) Version/5.0.1 Safari/531.6.6'
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10 10_8 rv:3.0; kk-KZ) AppleWebKit/531.6.3 (KHTML, like Gecko) Version/5.0.1 Safari/531.6.3'
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10 6_2 rv:3.0; ast-ES) AppleWebKit/535.16.3 (KHTML, like Gecko) Version/4.0 Safari/535.16.3'
user_agent()

Generate a random web browser user agent string.

Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.user_agent()
...
'Opera/9.61.(X11; Linux x86_64; az-IN) Presto/2.9.190 Version/12.00'
'Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 5.0; Trident/5.0)'
'Mozilla/5.0 (iPod; U; CPU iPhone OS 3_2 like Mac OS X; ht-HT) AppleWebKit/532.19.2 (KHTML, like Gecko) Version/4.0.5 Mobile/8B116 Safari/6532.19.2'
'Mozilla/5.0 (iPad; CPU iPad OS 10_3_4 like Mac OS X) AppleWebKit/531.2 (KHTML, like Gecko) FxiOS/12.5s3513.0 Mobile/01P609 Safari/531.2'
'Mozilla/5.0 (iPod; U; CPU iPhone OS 4_3 like Mac OS X; st-ZA) AppleWebKit/535.19.4 (KHTML, like Gecko) Version/3.0.5 Mobile/8B112 Safari/6535.19.4'
windows_platform_token()

Generate a Windows platform token used in user agent strings.

Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.windows_platform_token()
...
'Windows NT 5.01'
'Windows NT 10.0'
'Windows NT 5.01'
'Windows 95'
'Windows NT 4.0'