Skip to content

Incomplete text scraping (ST32-004) #17

Description

@buhbbl

Hello, the Silvers Rayleigh card on the asian english website is malformed. The html for the effect text contains a <slash> tag, which I assume was an error on bandai's part as they probably wanted to include a slash attribute reference but instead created slash tag. Is it possible to avoid this by scraping the whole inner HTML and the excluding the "Effect" h3 title tag?

<div class="text">
    <h3>Effect</h3>
    If your Leader has the 
    <slash> 
        attribute, this Character gains [Rush: Character].<br>(This card can attack Characters on the turn in which it is played.)<br>[On Play] Rest up to 2 of your opponent's Characters with a cost of 2 or less.
    </slash>
</div>

Reproduction of the issue:

$ vega pull -l english-asia cards 556032

Expected output:

...
{
	"id": "ST32-004",
	"pack_id": "556032",
	"name": "Silvers Rayleigh",
	"rarity": "Common",
	"category": "Character",
	"img_url": "../images/cardlist/card/ST32-004.png?260707",
	"img_full_url": "https://asia-en.onepiece-cardgame.com/images/cardlist/card/ST32-004.png?260707",
	"cost": 4,
	"attributes": [
		"Slash"
	],
	"power": 5000,
	"counter": 1000,
	"colors": [
		"Green"
	],
	"block_number": 5,
	"types": [
		"Former Roger Pirates"
	],
	"effect": "If your Leader has the attribute, this Character gains [Rush: Character].<br>(This card can attack Characters on the turn in which it is played.)<br>[On Play] Rest up to 2 of your opponent's Characters with a cost of 2 or less.", # Issue is here.
	"trigger": null
},
...

Current output:

...
{
	"id": "ST32-004",
	"pack_id": "556032",
	"name": "Silvers Rayleigh",
	"rarity": "Common",
	"category": "Character",
	"img_url": "../images/cardlist/card/ST32-004.png?260707",
	"img_full_url": "https://asia-en.onepiece-cardgame.com/images/cardlist/card/ST32-004.png?260707",
	"cost": 4,
	"attributes": [
		"Slash"
	],
	"power": 5000,
	"counter": 1000,
	"colors": [
		"Green"
	],
	"block_number": 5,
	"types": [
		"Former Roger Pirates"
	],
	"effect": "If your Leader has the", # Issue is here
	"trigger": null
},
...

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions