Create csv files for weapons
Default python gitignore Create readme.md Fix table markdown Create requirements.txt Redo file structure Final delete chromedrivemerge-requests/24/head
parent
e0c87292ad
commit
a67a793f63
|
@ -1 +1,111 @@
|
|||
# Custom files
|
||||
pf2.db
|
||||
|
||||
##############################
|
||||
# Standard python git ignore #
|
||||
##############################
|
||||
|
||||
# Byte-compiled / optimized / DLL files
|
||||
__pycache__/
|
||||
*.py[cod]
|
||||
*$py.class
|
||||
|
||||
# C extensions
|
||||
*.so
|
||||
|
||||
# Distribution / packaging
|
||||
.Python
|
||||
build/
|
||||
develop-eggs/
|
||||
dist/
|
||||
downloads/
|
||||
eggs/
|
||||
.eggs/
|
||||
lib/
|
||||
lib64/
|
||||
parts/
|
||||
sdist/
|
||||
var/
|
||||
wheels/
|
||||
*.egg-info/
|
||||
.installed.cfg
|
||||
*.egg
|
||||
MANIFEST
|
||||
|
||||
# PyInstaller
|
||||
# Usually these files are written by a python script from a template
|
||||
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
||||
*.manifest
|
||||
*.spec
|
||||
|
||||
# Installer logs
|
||||
pip-log.txt
|
||||
pip-delete-this-directory.txt
|
||||
|
||||
# Unit test / coverage reports
|
||||
htmlcov/
|
||||
.tox/
|
||||
.coverage
|
||||
.coverage.*
|
||||
.cache
|
||||
nosetests.xml
|
||||
coverage.xml
|
||||
*.cover
|
||||
.hypothesis/
|
||||
.pytest_cache/
|
||||
|
||||
# Translations
|
||||
*.mo
|
||||
*.pot
|
||||
|
||||
# Django stuff:
|
||||
*.log
|
||||
local_settings.py
|
||||
db.sqlite3
|
||||
|
||||
# Flask stuff:
|
||||
instance/
|
||||
.webassets-cache
|
||||
|
||||
# Scrapy stuff:
|
||||
.scrapy
|
||||
|
||||
# Sphinx documentation
|
||||
docs/_build/
|
||||
|
||||
# PyBuilder
|
||||
target/
|
||||
|
||||
# Jupyter Notebook
|
||||
.ipynb_checkpoints
|
||||
|
||||
# pyenv
|
||||
.python-version
|
||||
|
||||
# celery beat schedule file
|
||||
celerybeat-schedule
|
||||
|
||||
# SageMath parsed files
|
||||
*.sage.py
|
||||
|
||||
# Environments
|
||||
.env
|
||||
.venv
|
||||
env/
|
||||
venv/
|
||||
ENV/
|
||||
env.bak/
|
||||
venv.bak/
|
||||
|
||||
# Spyder project settings
|
||||
.spyderproject
|
||||
.spyproject
|
||||
|
||||
# Rope project settings
|
||||
.ropeproject
|
||||
|
||||
# mkdocs documentation
|
||||
/site
|
||||
|
||||
# mypy
|
||||
.mypy_cache/
|
|
@ -0,0 +1,67 @@
|
|||
,Name,Category,Price,Damage,Bulk,Hands,Group,Weapon Traits,description
|
||||
0,Fist,Unarmed,,1d4 B,,1,Brawling,"Agile, Finesse, Nonlethal, Unarmed",Nethys Note: no description was provided for this item
|
||||
1,Clan Dagger,Simple,2 gp,1d4 P,L,1,Knife,"Agile, Dwarf, Parry, Uncommon, Versatile B","This broad dagger is carried by dwarves as a weapon, tool, and designation of clan. Losing or having to surrender a clan dagger is considered a mark of embarrassment to most dwarves."
|
||||
2,Club,Simple,0,1d6 B,1,1,Club,Thrown 10 ft.,This is a piece of stout wood shaped or repurposed to bludgeon an enemy. Clubs can be intricately carved pieces of martial art or as simple as a tree branch or piece of wood.
|
||||
3,Dagger,Simple,2 sp,1d4 P,L,1,Knife,"Agile, Finesse, Thrown 10 ft., Versatile S","This small, bladed weapon is held in one hand and used to stab a creature in close combat. It can also be thrown."
|
||||
4,Gauntlet,Simple,2 sp,1d4 B,L,1,Brawling,"Agile, Free-Hand","A pair of these metal gloves comes with full plate, half plate, and splint armor; they can also be purchased separately and worn with other types of armor. They not only protect your hands but also transform your hands into lethal weapons."
|
||||
5,Katar,Simple,3 sp,1d4 P,L,1,Knife,"Agile, Deadly d6, Monk, Uncommon","Also known as punching daggers, katars are characterized by their H-shaped hand grip that allows the blade to jut out from the knuckles."
|
||||
6,Light Mace,Simple,4 sp,1d4 B,L,1,Club,"Agile, Finesse, Shove","A light mace has a short wooden or metal shaft ending with a dense metal head. Used much like a club, it delivers heavy bludgeoning blows, but with extra power derived from the head’s metal ridges or spikes."
|
||||
7,Longspear,Simple,5 sp,1d8 P,2,2,Spear,Reach,"This very long spear, sometimes called a pike, is purely for thrusting rather than throwing. Used by many soldiers and city watch for crowd control and defense against charging enemies, it must be wielded with two hands."
|
||||
8,Mace,Simple,1 gp,1d6 B,1,1,Club,Shove,"With a stout haft and a heavy metal head, a mace is sturdy and allows its wielder to deliver powerful blows and dent armor."
|
||||
9,Morningstar,Simple,1 gp,1d6 B,1,1,Club,Versatile P,This weapon has a short shaft ending in a metal ball studded with spikes.
|
||||
10,Sickle,Simple,2 sp,1d4 S,L,1,Knife,"Agile, Finesse, Trip","Originally a farming tool used for reaping grain, this one-handed weapon has a short wooden handle ending in a curved blade, sometimes sharpened on both sides."
|
||||
11,Spear,Simple,1 sp,1d6 P,1,1,Spear,Thrown 20 ft.,"A long metal shaft ending with a metal spike, a spear can be used one-handed as a melee weapon and can be thrown."
|
||||
12,Spiked Gauntlet,Simple,3 sp,1d4 P,L,1,Brawling,"Agile, Free-Hand","Providing the same defensive function as a standard gauntlet, this version has a group of spikes protruding from the knuckles to deliver piercing damage with a punch."
|
||||
13,Staff,Simple,0,1d4 B,1,1,Club,Two-Hand d8,This long piece of wood can aid in walking and deliver a mighty blow.
|
||||
14,Bastard Sword,Martial,4 gp,1d8 S,1,1,Sword,Two-Hand d12,"This broad-bladed sword, sometimes called the hand‑and‑a‑half sword, has a longer grip so it can be held in one hand or used with two hands to provide extra piercing or slashing power."
|
||||
15,Battle Axe,Martial,1 sp,1d8 S,1,1,Axe,Sweep,"These axes are designed explicitly as weapons, rather than tools. They typically weigh less, with a shaft reinforced with metal bands or bolts, and have a sharper blade, making them ideal for chopping limbs rather than wood."
|
||||
16,Bo Staff,Martial,2 sp,1d8 B,2,2,Club,"Monk, Parry, Reach, Trip",This strong but slender staff is tapered at the ends and well balanced. It’s designed to be an offensive and defensive weapon.
|
||||
17,Dogslicer,Martial,1 sp,1d6 S,L,1,Sword,"Agile, Backstabber, Finesse, Goblin, Uncommon","This short, curved, and crude makeshift blade often has holes drilled into it to reduce its weight. It’s a favored weapon of goblins."
|
||||
18,Elven Curve Blade,Martial,4 gp,1d8 S,2,2,Sword,"Elf, Finesse, Forceful","Essentially a longer version of the scimitar, this traditional elven weapon has a thinner blade than its cousin."
|
||||
19,Falchion,Martial,3 gp,1d10 S,2,2,Sword,"Forceful, Sweep","This weapon is a heavier, two-handed version of the curved-bladed scimitar. It is weighted toward the blade’s end, making it a powerful slashing weapon."
|
||||
20,Filcher's Fork,Martial,1 gp,1d4 P,L,1,Spear,"Agile, Backstabber, Deadly d6, Finesse, Halfling, Thrown 20 ft., Uncommon","This halfling weapon looks like a long, two-pronged fork and is used as both a weapon and a cooking implement."
|
||||
21,Flail,Martial,1 gp,1d6 B,1,1,Flail,"Disarm, Sweep, Trip","This weapon consists of a wooden handle attached to a spiked ball or cylinder by a chain, rope, or strap of leather."
|
||||
22,Glaive,Martial,2 gp,1d8 S,2,2,Polearm,"Deadly d8, Forceful, Reach","This polearm consists of a long, single-edged blade on the end of a 7-foot pole. It is extremely effective at delivering lethal cuts at a distance."
|
||||
23,Gnome Hooked Hammer,Martial,2 gp,1d6 B,1,1,Hammer,"Gnome, Trip, Two-Hand d10, Uncommon, Versatile P",This gnome tool and weapon features a hammer at one end and a curved pick on the other. It’s such a strange and awkward weapon that others think the gnomes are slightly erratic for using it.
|
||||
24,Greataxe,Martial,1 gp,1d12 S,2,2,Axe,Sweep,"This large battle axe is too heavy to wield with only one hand. Many greataxes incorporate two blades, and they are often “bearded,” having a hook at the bottom to increase the strength of their chopping power."
|
||||
25,Greatclub,Martial,1 gp,1d10 B,2,2,Club,"Backswing, Shove","While many greatclubs are intricately carved, others are little more than a sturdy tree branch. These massive clubs are too heavy to wield with only one hand."
|
||||
26,Greatpick,Martial,2 gp,1d10 P,2,2,Pick,Fatal d12,This pick has a longer handle and broader head than a regular pick. It is too heavy to wield in one hand.
|
||||
27,Greatsword,Martial,2 gp,1d12 S,2,2,Sword,Versatile P,This immense two-handed sword is nearly as tall as its wielder. Its lower blade is often somewhat dulled to allow it to be gripped for extra leverage in close-quarter fights.
|
||||
28,Guisarme,Martial,2 gp,1d10 S,2,2,Polearm,"Reach, Trip","This polearm bears a long, often one‑sided, curved blade with a hook protruding from the blunt side of the blade, which can allow its wielder to trip opponents at a distance. Its shaft is usually 8 feet long."
|
||||
29,Halberd,Martial,2 gp,1d10 P,2,2,Polearm,"Reach, Versatile S","This polearm has a relatively short, 5-foot shaft. The business end is a long spike with an axe blade attached."
|
||||
30,Hatchet,Martial,4 sp,1d6 S,L,1,Axe,"Agile, Sweep, Thrown 10 ft.",This small axe can be used in close combat or thrown.
|
||||
31,Horsechopper,Martial,9 sp,1d8 S,2,2,Polearm,"Goblin, Reach, Trip, Uncommon, Versatile P","Created by goblins to battle horses, this weapon is essentially a long shaft ending in a blade with a large hook."
|
||||
32,Kama,Martial,1 gp,1d6 S,L,1,Knife,"Agile, Monk, Trip, Uncommon","Similar to a sickle and used in some regions to reap grain, a kama has a short, slightly curved blade and a wooden handle."
|
||||
33,Katana,Martial,2 gp,1d6 S,1,1,Sword,"Deadly d8, Two-Hand d10, Uncommon, Versatile P","A katana is a curved, single-edged sword known for its wickedly sharped blade."
|
||||
34,Kukri,Martial,6 sp,1d6 S,L,1,Knife,"Agile, Finesse, Trip, Uncommon",The blade of this foot-long knife curves inward and lacks a cross guard at the hilt.
|
||||
35,Lance,Martial,1 gp,1d8 P,2,2,Spear,"Deadly d8, Jousting d6, Reach",This spear-like weapon is used by a mounted creature to deal a great deal of damage.
|
||||
36,Light Hammer,Martial,3 sp,1d6 B,L,1,Hammer,"Agile, Thrown 20 ft.","This smaller version of the warhammer has a wooden or metal shaft ending in a metal head. Unlike its heavier cousin, it is light enough to throw."
|
||||
37,Light Pick,Martial,4 sp,1d4 P,L,1,Pick,"Agile, Fatal d8",A light pick is a modified mining implement with a wooden shaft ending in a pick head crafted more to pierce armor and flesh than chip rocks.
|
||||
38,Longsword,Martial,1 gp,1d8 S,1,1,Sword,Versatile P,Longswords can be one-edged or two‑edged swords. Their blades are heavy and they’re between 3 and 4 feet in length.
|
||||
39,Main-gauche,Martial,5 sp,1d4 P,L,1,Knife,"Agile, Disarm, Finesse, Parry, Versatile S",This parrying dagger features a robust guard to protect the wielder’s hand.
|
||||
40,Maul,Martial,3 gp,1d12 B,2,2,Hammer,Shove,Mauls are massive warhammers that must be swung with two hands.
|
||||
41,Nunchaku,Martial,2 sp,1d6 B,L,1,Club,"Backswing, Disarm, Finesse, Monk, Uncommon",The nunchaku is constructed of two wooden or metal bars connected by a short length of rope or chain.
|
||||
42,Orc Knuckle Dagger,Martial,7 sp,1d6 P,L,1,Knife,"Agile, Disarm, Orc, Uncommon","This stout, metal blade of orc design has a horizontal basket hilt with blades jutting from each end, or sometimes one blade like that of a katar."
|
||||
43,Pick,Martial,7 sp,1d6 P,1,1,Pick,Fatal d10,"A pick designed solely for combat has a sturdy wooden shaft and a heavy, pointed head to deliver devastating blows."
|
||||
44,Ranseur,Martial,2 gp,1d10 P,2,2,Polearm,"Disarm, Reach",This polearm is a long trident with a central prong that’s longer than the other two.
|
||||
45,Rapier,Martial,2 gp,1d6 P,1,1,Sword,"Deadly d8, Disarm, Finesse",The rapier is a long and thin piercing blade with a basket hilt. It is prized among many as a dueling weapon.
|
||||
46,Sai,Martial,6 sp,1d4 P,L,1,Knife,"Agile, Disarm, Finesse, Monk, Uncommon, Versatile B",This piercing dagger is a metal spike flanked by a pair of prongs that can be used to trap an enemy’s weapon.
|
||||
47,Sap,Martial,1 sp,1d6 B,L,1,Club,"Agile, Nonlethal","A sap has a soft wrapping around a dense core, typically a leather sheath around a lead rod. Its head is wider than its grip to disperse the force of a blow, as the weapon’s purpose is to knock out its victim rather than to draw blood."
|
||||
48,Scimitar,Martial,1 gp,1d6 S,1,1,Sword,"Forceful, Sweep",This one-handed curved blade is sharp on one side.
|
||||
49,Scythe,Martial,2 gp,1d10 S,2,2,Polearm,"Deadly d10, Trip","Derived from a farming tool used to mow down long grains and cereals, this weapon has a long wooden shaft with protruding handles, capped with a curved blade set at a right angle."
|
||||
50,Shield Bash,Martial,,1d4 B,,1,Shield,,"A shield bash is not actually a weapon, but a maneuver in which you thrust or swing your shield to hit your foe with an impromptu attack."
|
||||
51,Shield Boss,Martial,5 sp,1d6 B,,1,Shield,Attached to Shield,"Typically a round, convex, or conical piece of thick metal attached to the center of a shield, a shield boss increases the bludgeoning damage of a shield bash."
|
||||
52,Shield Spikes,Martial,5 sp,1d6 P,,1,Shield,Attached to Shield,These metal spikes are strategically placed on the defensive side of the shield to deal piercing damage with a shield bash.
|
||||
53,Shortsword,Martial,9 sp,1d6 P,L,1,Sword,"Agile, Finesse, Versatile S","These blades come in a variety of shapes and styles, but they are typically 2 feet long."
|
||||
54,Spiked Chain,Martial,3 gp,1d8 S,1,2,Flail,"Disarm, Finesse, Trip, Uncommon",This 4‑foot‑long length of chain is covered with barbs and has spikes on one or both ends. Some feature metal hoops used as handgrips.
|
||||
55,Starknife,Martial,2 gp,1d4 P,L,1,Knife,"Agile, Deadly d6, Finesse, Thrown 20 ft., Versatile S","From a central metal ring, four tapering metal blades extend like points on a compass rose. When gripping a starknife from the center, the wielder can use it as a melee weapon. It can also be thrown short distances."
|
||||
56,Temple Sword,Martial,2 gp,1d8 S,1,1,Sword,"Monk, Trip, Uncommon","This heavy blade is favored by guardians of religious sites. It has a distinctive, crescent-shaped blade that seems to be a mix of a sickle and sword. It often has holes drilled into the blade or the pommel so that bells or other holy trinkets can be affixed to the weapon as an aid for prayer or mediation."
|
||||
57,Trident,Martial,1 gp,1d8 P,1,1,Spear,Thrown 20 ft.,"This three-pronged, spear-like weapon typically has a 4-foot shaft. Like a spear, it can be wielded with one hand or thrown."
|
||||
58,War Flair,Martial,2 gp,1d10 B,2,2,Flail,"Disarm, Sweep, Trip",
|
||||
59,Warhammer,Martial,1 gp,1d8 B,1,1,Hammer,Shove,"This weapon has a wooden shaft ending in a large, heavy metal head. The head of the hammer might be single-sided or double-sided, but it’s always capable of delivering powerful bludgeoning blows."
|
||||
60,Whip,Martial,1 sp,1d4 S,1,1,Flail,"Disarm, Finesse, Nonlethal, Reach, Trip","This long strand of thick leather, often braided, delivers a painful but nonlethal slash at a distance, usually accompanied by a distinctive cracking sound."
|
||||
61,Aklys,Advanced,5 gp,1d6 B,1,1,Club,"Ranged Trip, Tethered, Thrown 20 feet, Trip, Uncommon",
|
||||
62,Dwarven War Axe,Advanced,3 gp,1d8 S,2,1,Axe,"Dwarf, Sweep, Two-Hand d12","This favored weapon of the dwarves has a large, ornate head mounted on a thick handle. This powerful axe can be wielded with one hand or two."
|
||||
63,Gnome Flickmace,Advanced,3 gp,1d8 B,2,1,Flail,"Gnome, Reach, Uncommon","More a flail than a mace, this weapon has a short handle attached to a length of chain with a ball at the end. The ball is propelled to its reach with the flick of the wrist, the momentum of which brings the ball back to the wielder after the strike."
|
||||
64,Orc Necksplitter,Advanced,2 gp,1d8 S,1,1,Axe,"Forceful, Orc, Sweep, Uncommon",This single-bladed bearded axe has a jagged blade that’s perfect for separating bone from tendon and cartilage.
|
||||
65,Sawtooth Saber,Advanced,5 gp,1d8 S,L,1,Sword,"Agile, Finesse, Twin, Uncommon","The signature weapon of the Red Mantis assassins, this curved blade is serrated like a saw, hence the name."
|
|
|
@ -0,0 +1,19 @@
|
|||
,Name,Category,Price,Damage,Range,Reload,Bulk,Hands,Group,Weapon Traits,description
|
||||
0,Blowgun,Simple,1 sp,1.00,20 ft.,1.0,L,1,Dart,"Agile, Nonlethal","This long, narrow tube is used for shooting blowgun darts, using only the power of a forcefully exhaled breath."
|
||||
1,Crossbow,Simple,3 gp,1d8 P,120 ft.,1.0,1,2,Bow,,"This ranged weapon has a bow-like assembly mounted on a handled frame called a tiller. The tiller has a mechanism to lock the bowstring in place, attached to a trigger mechanism that releases the tension and launches a bolt."
|
||||
2,Dart,Simple,1 cp,1d4 P,20 ft.,,L,1,Dart,"Agile, Thrown",This thrown weapon is larger than an arrow but shorter than a javelin. It typically has a short shaft of wood ending in a metal tip and is sometimes stabilized by feathers or fur.
|
||||
3,Hand Crossbow,Simple,3 gp,1d6 P,60 ft.,1.0,L,1,Bow,,"Sometimes referred to as an alley bow by rogues or ruffians, this small crossbow fires small bolts that are sometimes used to deliver poison to the target. It’s small enough to be shot one-handed, but it still requires two hands to load."
|
||||
4,Heavy Crossbow,Simple,4 gp,1d10 P,120 ft.,2.0,2,2,Bow,,"This large crossbow is harder to load and more substantial than a regular crossbow, but it packs a greater punch."
|
||||
5,Javelin,Simple,1 sp,1d6 P,30 ft.,,L,1,Dart,Thrown,This thin spear is well balanced for throwing but is not designed for melee use.
|
||||
6,Sling,Simple,0,1d6 B,50 ft.,1.0,L,1,Sling,Propulsive,"Little more than a leather cup attached to a pair of straps, a sling can be used to fling smooth stones or sling bullets at a range."
|
||||
7,Alchemical Bomb,Martial,,Varies,20 ft.,,L,1,Bomb,,"These bombs come in a variety of types and levels of power, but no matter the variety, you throw the bomb at the target and it explodes, unleashing its alchemical blast."
|
||||
8,Composite Longbow,Martial,20 gp,1d8 P,100 ft.,0.0,2,1+,Bow,"Deadly d10, Propulsive, Volley 30 ft.","This projectile weapon is made from horn, wood, and sinew laminated together to increase the power of its pull and the force of its projectile. Like all longbows, its great size also increases the bow’s range and power. You must use two hands to fire it, and it cannot be used while mounted. Any time an ability is specifically restricted to a longbow, such as Erastil’s favored weapon, it also applies to composite longbows unless otherwise stated."
|
||||
9,Composite Shortbow,Martial,14 gp,1d6 P,60 ft.,0.0,1,1+,Bow,"Deadly d10, Propulsive","This shortbow is made from horn, wood, and sinew laminated together to increase the power of its pull and the force of its projectile. Its compact size and power make it a favorite of mounted archers. Any time an ability is specifically restricted to a shortbow, it also applies to composite shortbows unless otherwise stated."
|
||||
10,Halfling Sling Staff,Martial,5 gp,1d10 B,80 ft.,1.0,1,2,Sling,"Halfling, Propulsive, Uncommon",This staff ends in a Y-shaped split that cradles a sling. The length of the staff provides excellent leverage when used two‑handed to fling rocks or bullets from the sling.
|
||||
11,Longbow,Martial,6 gp,1d8 P,100 ft.,0.0,2,1+,Bow,"Deadly d10, Volley 30 ft.","This 5-foot-tall bow, usually made of a single piece of elm, hickory, or yew, has a powerful draw and is excellent at propelling arrows with great force and at an extreme distance. You must use two hands to fire a longbow, and it can’t be used while mounted."
|
||||
12,Shortbow,Martial,3 gp,1d6 P,60 ft.,0.0,1,1+,Bow,Deadly d10,This smaller bow is made of a single piece of wood and favored by skirmishers and cavalry.
|
||||
13,Shuriken,Martial,1 cp,1d4 P,20 ft.,0.0,,1,Dart,"Agile, Monk, Thrown, Uncommon","This “throwing star” is a small piece of flat metal with sharp edges, designed to be flung with a flick of the wrist."
|
||||
14,Arrows,Ammunition,1 sp (price for 10),,,,L,,Bow,,These projectiles are the ammunition for bows. The shaft of an arrow is made of wood. It is stabilized in flight by fletching at one end and bears a metal head on the other.
|
||||
15,Blowgun Darts,Ammunition,5 cp (price for 10),,,,L,,Dart,,"These thin, light darts are typically made of hardwood and stabilized with fletching of down or fur. They are often hollow so they can be used to deliver poison."
|
||||
16,Bolts,Ammunition,1 sp (price for 10),,,,L,,Bow,,"Shorter than traditional arrows but similar in construction, bolts are the ammunition used by crossbows."
|
||||
17,Sling Bullets,Ammunition,1 cp (price for 10),,,,L,,Sling,,"These are small metal balls, typically either iron or lead, designed to be used as ammunition in slings."
|
|
|
@ -0,0 +1,256 @@
|
|||
{
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"# Scrape data from aon2e and generate csvs to import in to sqlite"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 1,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# Dependencies\n",
|
||||
"import pandas as pd\n",
|
||||
"from bs4 import BeautifulSoup as bs\n",
|
||||
"import os\n",
|
||||
"from splinter import Browser\n",
|
||||
"\n",
|
||||
"# Setting up Selenium\n",
|
||||
"chrome_driver = os.path.join('..', 'resources', 'chromedriver.exe')\n",
|
||||
"executable_path = {'executable_path': chrome_driver}\n",
|
||||
"browser = Browser('chrome', **executable_path, headless=False)\n",
|
||||
"\n",
|
||||
"# Pandas config\n",
|
||||
"pd.set_option('display.max_columns', None)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 2,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"Beginning Data Retrieval\n",
|
||||
"------------------------\n",
|
||||
"Processing Weapon 1 of 83 | Fist\n",
|
||||
"Processing Weapon 2 of 83 | Club\n",
|
||||
"Processing Weapon 3 of 83 | Dagger\n",
|
||||
"Processing Weapon 4 of 83 | Gauntlet\n",
|
||||
"Processing Weapon 5 of 83 | Light Mace\n",
|
||||
"Processing Weapon 6 of 83 | Longspear\n",
|
||||
"Processing Weapon 7 of 83 | Mace\n",
|
||||
"Processing Weapon 8 of 83 | Morningstar\n",
|
||||
"Processing Weapon 9 of 83 | Sickle\n",
|
||||
"Processing Weapon 10 of 83 | Spear\n",
|
||||
"Processing Weapon 11 of 83 | Spiked Gauntlet\n",
|
||||
"Processing Weapon 12 of 83 | Staff\n",
|
||||
"Processing Weapon 13 of 83 | Clan Dagger\n",
|
||||
"Processing Weapon 14 of 83 | Katar\n",
|
||||
"Processing Weapon 15 of 83 | Bastard Sword\n",
|
||||
"Processing Weapon 16 of 83 | Battle Axe\n",
|
||||
"Processing Weapon 17 of 83 | Bo Staff\n",
|
||||
"Processing Weapon 18 of 83 | Falchion\n",
|
||||
"Processing Weapon 19 of 83 | Flail\n",
|
||||
"Processing Weapon 20 of 83 | Glaive\n",
|
||||
"Processing Weapon 21 of 83 | Greataxe\n",
|
||||
"Processing Weapon 22 of 83 | Greatclub\n",
|
||||
"Processing Weapon 23 of 83 | Greatpick\n",
|
||||
"Processing Weapon 24 of 83 | Greatsword\n",
|
||||
"Processing Weapon 25 of 83 | Guisarme\n",
|
||||
"Processing Weapon 26 of 83 | Halberd\n",
|
||||
"Processing Weapon 27 of 83 | Hatchet\n",
|
||||
"Processing Weapon 28 of 83 | Lance\n",
|
||||
"Processing Weapon 29 of 83 | Light Hammer\n",
|
||||
"Processing Weapon 30 of 83 | Light Pick\n",
|
||||
"Processing Weapon 31 of 83 | Longsword\n",
|
||||
"Processing Weapon 32 of 83 | Main-gauche\n",
|
||||
"Processing Weapon 33 of 83 | Maul\n",
|
||||
"Processing Weapon 34 of 83 | Pick\n",
|
||||
"Processing Weapon 35 of 83 | Ranseur\n",
|
||||
"Processing Weapon 36 of 83 | Rapier\n",
|
||||
"Processing Weapon 37 of 83 | Sap\n",
|
||||
"Processing Weapon 38 of 83 | Scimitar\n",
|
||||
"Processing Weapon 39 of 83 | Scythe\n",
|
||||
"Processing Weapon 40 of 83 | Shield Bash\n",
|
||||
"Processing Weapon 41 of 83 | Shield Boss\n",
|
||||
"Processing Weapon 42 of 83 | Shield Spikes\n",
|
||||
"Processing Weapon 43 of 83 | Shortsword\n",
|
||||
"Processing Weapon 44 of 83 | Starknife\n",
|
||||
"Processing Weapon 45 of 83 | Trident\n",
|
||||
"Processing Weapon 46 of 83 | War Flail\n",
|
||||
"Processing Weapon 47 of 83 | Warhammer\n",
|
||||
"Processing Weapon 48 of 83 | Whip\n",
|
||||
"Processing Weapon 49 of 83 | Dogslicer\n",
|
||||
"Processing Weapon 50 of 83 | Elven Curve Blade\n",
|
||||
"Processing Weapon 51 of 83 | Filcher's Fork\n",
|
||||
"Processing Weapon 52 of 83 | Gnome Hooked Hammer\n",
|
||||
"Processing Weapon 53 of 83 | Horsechopper\n",
|
||||
"Processing Weapon 54 of 83 | Kama\n",
|
||||
"Processing Weapon 55 of 83 | Katana\n",
|
||||
"Processing Weapon 56 of 83 | Kukri\n",
|
||||
"Processing Weapon 57 of 83 | Nunchaku\n",
|
||||
"Processing Weapon 58 of 83 | Orc Knuckle Dagger\n",
|
||||
"Processing Weapon 59 of 83 | Sai\n",
|
||||
"Processing Weapon 60 of 83 | Spiked Chain\n",
|
||||
"Processing Weapon 61 of 83 | Temple Sword\n",
|
||||
"Processing Weapon 62 of 83 | Dwarven War Axe\n",
|
||||
"Processing Weapon 63 of 83 | Gnome Flickmace\n",
|
||||
"Processing Weapon 64 of 83 | Orc Necksplitter\n",
|
||||
"Processing Weapon 65 of 83 | Sawtooth Saber\n",
|
||||
"Processing Weapon 66 of 83 | Blowgun\n",
|
||||
"Processing Weapon 67 of 83 | Crossbow\n",
|
||||
"Processing Weapon 68 of 83 | Dart\n",
|
||||
"Processing Weapon 69 of 83 | Hand Crossbow\n",
|
||||
"Processing Weapon 70 of 83 | Heavy Crossbow\n",
|
||||
"Processing Weapon 71 of 83 | Javelin\n",
|
||||
"Processing Weapon 72 of 83 | Sling\n",
|
||||
"Processing Weapon 73 of 83 | Alchemical Bomb\n",
|
||||
"Processing Weapon 74 of 83 | Composite Longbow\n",
|
||||
"Processing Weapon 75 of 83 | Composite Shortbow\n",
|
||||
"Processing Weapon 76 of 83 | Longbow\n",
|
||||
"Processing Weapon 77 of 83 | Shortbow\n",
|
||||
"Processing Weapon 78 of 83 | Halfling Sling Staff\n",
|
||||
"Processing Weapon 79 of 83 | Shuriken\n",
|
||||
"Processing Weapon 80 of 83 | Blowgun Darts\n",
|
||||
"Processing Weapon 81 of 83 | Bolts\n",
|
||||
"Processing Weapon 82 of 83 | Sling Bullets\n",
|
||||
"Processing Weapon 83 of 83 | Arrows\n",
|
||||
"------------------------\n",
|
||||
"Data Retrieval Complete\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"# url that contains all the links\n",
|
||||
"url_weapon = 'https://2e.aonprd.com/Weapons.aspx?ID='\n",
|
||||
"\n",
|
||||
"# Number of weapons\n",
|
||||
"number_of_weapons = 83\n",
|
||||
"\n",
|
||||
"# Empty lists to store the scraped values\n",
|
||||
"name_list = []\n",
|
||||
"description_list = []\n",
|
||||
"\n",
|
||||
"print(f'Beginning Data Retrieval')\n",
|
||||
"print(f'------------------------')\n",
|
||||
"\n",
|
||||
"# Loop from 1 to the value in weapon_number\n",
|
||||
"for weapon in range(1, number_of_weapons+1):\n",
|
||||
" \n",
|
||||
" url = url_weapon + str(weapon)\n",
|
||||
" browser.visit(url)\n",
|
||||
" html = browser.html\n",
|
||||
" soup = bs(html, 'html.parser')\n",
|
||||
"\n",
|
||||
" # Select only the content section\n",
|
||||
" content = soup.find(id='ctl00_MainContent_DetailedOutput')\n",
|
||||
"\n",
|
||||
" try:\n",
|
||||
" # Store the name and description\n",
|
||||
" name = content.find('a').text.strip()\n",
|
||||
" \n",
|
||||
" except:\n",
|
||||
" name = f'weapon: {weapon}'\n",
|
||||
"\n",
|
||||
" try:\n",
|
||||
" description = content.find('hr').next.text.strip()\n",
|
||||
" \n",
|
||||
" except:\n",
|
||||
" description = content.find('hr').next.strip()\n",
|
||||
" \n",
|
||||
" print(f'Processing Weapon {weapon} of {number_of_weapons} | {name}')\n",
|
||||
"\n",
|
||||
" # Append values to our empty lists\n",
|
||||
" name_list.append(name) \n",
|
||||
" description_list.append(description)\n",
|
||||
"\n",
|
||||
"print(f'------------------------')\n",
|
||||
"print(f'Data Retrieval Complete')"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 3,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# Directory of csv files which are taken from https://2e.aonprd.com/Weapons.aspx\n",
|
||||
"melee = pd.read_csv('melee.csv')\n",
|
||||
"ranged = pd.read_csv('ranged.csv')"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 13,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"data = {'Name': name_list, 'description': description_list}\n",
|
||||
"scrape = pd.DataFrame(data)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 16,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"melee = melee.merge(scrape, how='left', on='Name')"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 17,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"ranged = ranged.merge(scrape, how='left', on='Name')"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 18,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"melee.to_csv('melee.csv')\n",
|
||||
"ranged.to_csv('ranged.csv')"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": []
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
"kernelspec": {
|
||||
"display_name": "Python 3",
|
||||
"language": "python",
|
||||
"name": "python3"
|
||||
},
|
||||
"language_info": {
|
||||
"codemirror_mode": {
|
||||
"name": "ipython",
|
||||
"version": 3
|
||||
},
|
||||
"file_extension": ".py",
|
||||
"mimetype": "text/x-python",
|
||||
"name": "python",
|
||||
"nbconvert_exporter": "python",
|
||||
"pygments_lexer": "ipython3",
|
||||
"version": "3.6.9"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 4
|
||||
}
|
Loading…
Reference in New Issue